@hypermid/sdk 1.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.
- package/README.md +71 -0
- package/dist/chain-registry.d.ts +104 -0
- package/dist/chain-registry.d.ts.map +1 -0
- package/dist/chain-registry.js +507 -0
- package/dist/chain-registry.js.map +1 -0
- package/dist/chains.d.ts +85 -0
- package/dist/chains.d.ts.map +1 -0
- package/dist/chains.js +97 -0
- package/dist/chains.js.map +1 -0
- package/dist/client.d.ts +257 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +477 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +56 -0
- package/dist/errors.js.map +1 -0
- package/dist/execution.d.ts +193 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +348 -0
- package/dist/execution.js.map +1 -0
- package/dist/helpers.d.ts +71 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +97 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +487 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/webhook-verify.d.ts +40 -0
- package/dist/webhook-verify.d.ts.map +1 -0
- package/dist/webhook-verify.js +76 -0
- package/dist/webhook-verify.js.map +1 -0
- package/package.json +45 -0
package/dist/chains.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chain ID constants for all supported chains.
|
|
3
|
+
*
|
|
4
|
+
* EVM chains use their standard numeric chain IDs.
|
|
5
|
+
* Non-EVM chains can be referenced by slug string (preferred) or numeric ID.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { ChainId, ChainSlug } from "@hypermid/sdk";
|
|
10
|
+
*
|
|
11
|
+
* // Numeric IDs (backwards compatible)
|
|
12
|
+
* const quote = await hm.getQuote({
|
|
13
|
+
* fromChain: ChainId.ETHEREUM, // 1
|
|
14
|
+
* toChain: ChainId.ARBITRUM, // 42161
|
|
15
|
+
* ...
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* // String slugs (recommended for non-EVM)
|
|
19
|
+
* const quote2 = await hm.getQuote({
|
|
20
|
+
* fromChain: ChainSlug.SOLANA, // "solana"
|
|
21
|
+
* toChain: ChainSlug.BITCOIN, // "bitcoin"
|
|
22
|
+
* ...
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import { CHAIN_REGISTRY, NI_CHAIN_BASE, resolveChain, } from "./chain-registry.js";
|
|
27
|
+
// ─── Numeric Chain IDs (backwards compatible) ────────────────────────────────
|
|
28
|
+
const NI_BASE = NI_CHAIN_BASE;
|
|
29
|
+
export const ChainId = {
|
|
30
|
+
// ─── EVM Chains ──────────────────────────────────────────────
|
|
31
|
+
ETHEREUM: 1,
|
|
32
|
+
OPTIMISM: 10,
|
|
33
|
+
BSC: 56,
|
|
34
|
+
GNOSIS: 100,
|
|
35
|
+
POLYGON: 137,
|
|
36
|
+
X_LAYER: 196,
|
|
37
|
+
ARBITRUM: 42161,
|
|
38
|
+
AVALANCHE: 43114,
|
|
39
|
+
BASE: 8453,
|
|
40
|
+
PLASMA: 1012,
|
|
41
|
+
BERACHAIN: 80094,
|
|
42
|
+
MONAD: 10143,
|
|
43
|
+
// ─── Non-EVM (LI.FI supported) ──────────────────────────────
|
|
44
|
+
SOLANA: 1151111081099710,
|
|
45
|
+
BITCOIN: 20000000000001,
|
|
46
|
+
SUI: 9270000000000000,
|
|
47
|
+
// ─── Near Intents-only chains ────────────────────────────────
|
|
48
|
+
NEAR: NI_BASE + 1,
|
|
49
|
+
TON: NI_BASE + 2,
|
|
50
|
+
TRON: NI_BASE + 3,
|
|
51
|
+
XRP: NI_BASE + 4,
|
|
52
|
+
DOGECOIN: NI_BASE + 5,
|
|
53
|
+
LITECOIN: NI_BASE + 6,
|
|
54
|
+
BITCOIN_CASH: NI_BASE + 7,
|
|
55
|
+
STELLAR: NI_BASE + 8,
|
|
56
|
+
CARDANO: NI_BASE + 9,
|
|
57
|
+
APTOS: NI_BASE + 10,
|
|
58
|
+
STARKNET: NI_BASE + 11,
|
|
59
|
+
DASH: NI_BASE + 12,
|
|
60
|
+
ZCASH: NI_BASE + 13,
|
|
61
|
+
ALEO: NI_BASE + 14,
|
|
62
|
+
ADI: NI_BASE + 15,
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Human-readable chain slug constants (recommended for non-EVM chains).
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { ChainSlug } from "@hypermid/sdk";
|
|
70
|
+
* const quote = await hm.getQuote({
|
|
71
|
+
* fromChain: ChainSlug.SOLANA, // "solana"
|
|
72
|
+
* toChain: ChainSlug.NEAR, // "near"
|
|
73
|
+
* ...
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export const ChainSlug = Object.fromEntries(CHAIN_REGISTRY.map((c) => [c.slug.toUpperCase().replace(/-/g, "_"), c.slug]));
|
|
78
|
+
/**
|
|
79
|
+
* Check if a chain ID belongs to a Near Intents-only chain.
|
|
80
|
+
* Accepts slug strings or numeric IDs.
|
|
81
|
+
*/
|
|
82
|
+
export function isNearIntentsChain(chainId) {
|
|
83
|
+
if (typeof chainId === "number") {
|
|
84
|
+
return chainId >= NI_BASE && chainId < NI_BASE + 1000;
|
|
85
|
+
}
|
|
86
|
+
const entry = resolveChain(chainId);
|
|
87
|
+
return entry !== null && entry.numericId >= NI_BASE && entry.numericId < NI_BASE + 1000;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Check if a chain supports wallet-connected deposit mode.
|
|
91
|
+
* Accepts slug strings or numeric IDs.
|
|
92
|
+
*/
|
|
93
|
+
export function supportsWalletDeposit(chainId) {
|
|
94
|
+
const entry = resolveChain(chainId);
|
|
95
|
+
return entry?.depositMode === "wallet";
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=chains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,GAEb,MAAM,qBAAqB,CAAC;AAE7B,gFAAgF;AAEhF,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,gEAAgE;IAChE,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,EAAE;IACZ,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,KAAK;IAEZ,+DAA+D;IAC/D,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,cAAc;IACvB,GAAG,EAAE,gBAAgB;IAErB,gEAAgE;IAChE,IAAI,EAAE,OAAO,GAAG,CAAC;IACjB,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,IAAI,EAAE,OAAO,GAAG,CAAC;IACjB,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,QAAQ,EAAE,OAAO,GAAG,CAAC;IACrB,QAAQ,EAAE,OAAO,GAAG,CAAC;IACrB,YAAY,EAAE,OAAO,GAAG,CAAC;IACzB,OAAO,EAAE,OAAO,GAAG,CAAC;IACpB,OAAO,EAAE,OAAO,GAAG,CAAC;IACpB,KAAK,EAAE,OAAO,GAAG,EAAE;IACnB,QAAQ,EAAE,OAAO,GAAG,EAAE;IACtB,IAAI,EAAE,OAAO,GAAG,EAAE;IAClB,KAAK,EAAE,OAAO,GAAG,EAAE;IACnB,IAAI,EAAE,OAAO,GAAG,EAAE;IAClB,GAAG,EAAE,OAAO,GAAG,EAAE;CACT,CAAC;AAIX;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CACzC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAClD,CAAC;AAE7B;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAwB;IACzD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,OAAO,IAAI,OAAO,IAAI,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IACxD,CAAC;IACD,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,SAAS,IAAI,OAAO,IAAI,KAAK,CAAC,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;AAC1F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAwB;IAC5D,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,KAAK,EAAE,WAAW,KAAK,QAAQ,CAAC;AACzC,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { HyperMidConfig, ChainsResponse, TokensParams, TokensResponse, ConnectionsParams, GasPricesParams, QuoteParams, QuoteResponse, RoutesParams, StatusParams, StatusResponse, ExecuteParams, ExecuteResponse, DepositSubmitParams, DepositSubmitResponse, DepositStatusParams, DepositStatusResponse, OnrampQuoteParams, OnrampCheckoutParams, OnrampCheckoutResponse, OnrampStatusResponse, OnrampConfigResponse, OnrampAssetsParams, SwapEventParams, SwapEventResponse, PartnerInfo, PartnerStats, PartnerStatsParams, Transaction, PaginatedResponse, PaginationParams, CreateWebhookParams, WebhookCreated, WebhooksListResponse, PingResponse, BalancesParams, BalancesResponse, InboundReceiverParams, InboundReceiverResponse } from "./types.js";
|
|
2
|
+
export declare class HyperMid {
|
|
3
|
+
private readonly baseUrl;
|
|
4
|
+
private readonly apiKey?;
|
|
5
|
+
private readonly timeout;
|
|
6
|
+
private readonly _fetch;
|
|
7
|
+
constructor(config?: HyperMidConfig);
|
|
8
|
+
private request;
|
|
9
|
+
private get;
|
|
10
|
+
private post;
|
|
11
|
+
private delete;
|
|
12
|
+
/**
|
|
13
|
+
* Get all supported chains (LI.FI + Near Intents).
|
|
14
|
+
* Cached server-side for 1 hour.
|
|
15
|
+
*/
|
|
16
|
+
getChains(): Promise<ChainsResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Get available tokens, optionally filtered by chains and keywords.
|
|
19
|
+
* Cached server-side for 5 minutes.
|
|
20
|
+
*/
|
|
21
|
+
getTokens(params?: TokensParams): Promise<TokensResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get available connections (which token pairs can be swapped).
|
|
24
|
+
*/
|
|
25
|
+
getConnections(params: ConnectionsParams): Promise<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Get available bridge/swap tools.
|
|
28
|
+
* Cached server-side for 1 hour.
|
|
29
|
+
*/
|
|
30
|
+
getTools(): Promise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Get gas prices for specified chains.
|
|
33
|
+
*/
|
|
34
|
+
getGasPrices(params: GasPricesParams): Promise<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Get the best swap quote for a token pair.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const quote = await hm.getQuote({
|
|
41
|
+
* fromChain: 1,
|
|
42
|
+
* fromToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
43
|
+
* fromAmount: "100000000", // 100 USDC
|
|
44
|
+
* toChain: 42161,
|
|
45
|
+
* toToken: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
|
|
46
|
+
* fromAddress: "0x...",
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
getQuote(params: QuoteParams): Promise<QuoteResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Get available routes for a token pair (multi-route comparison).
|
|
53
|
+
* Supports both GET and POST — SDK uses POST for flexibility.
|
|
54
|
+
*/
|
|
55
|
+
getRoutes(params: RoutesParams): Promise<unknown>;
|
|
56
|
+
/**
|
|
57
|
+
* Check the status of a cross-chain swap.
|
|
58
|
+
*
|
|
59
|
+
* @example LI.FI status
|
|
60
|
+
* ```ts
|
|
61
|
+
* const status = await hm.getStatus({
|
|
62
|
+
* txHash: "0x...",
|
|
63
|
+
* fromChain: 1,
|
|
64
|
+
* toChain: 42161,
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example Near Intents status
|
|
69
|
+
* ```ts
|
|
70
|
+
* const status = await hm.getStatus({
|
|
71
|
+
* provider: "near-intents",
|
|
72
|
+
* correlationId: "abc-123",
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
getStatus(params: StatusParams): Promise<StatusResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Get full transaction data for execution.
|
|
79
|
+
*
|
|
80
|
+
* **LI.FI routes**: Returns `transactionRequest` — sign and broadcast with your wallet.
|
|
81
|
+
*
|
|
82
|
+
* **Near Intents routes**: Returns `depositAddress` — send tokens there.
|
|
83
|
+
* Use `depositMode` to control wallet vs. manual flow.
|
|
84
|
+
*
|
|
85
|
+
* @example LI.FI swap
|
|
86
|
+
* ```ts
|
|
87
|
+
* const result = await hm.execute({
|
|
88
|
+
* fromChain: 1,
|
|
89
|
+
* fromToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
90
|
+
* fromAmount: "100000000",
|
|
91
|
+
* toChain: 42161,
|
|
92
|
+
* toToken: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
|
|
93
|
+
* fromAddress: "0x...",
|
|
94
|
+
* toAddress: "0x...",
|
|
95
|
+
* });
|
|
96
|
+
* if (result.provider === "lifi") {
|
|
97
|
+
* // Sign result.transactionRequest with your wallet
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @example Near Intents manual deposit (user hasn't connected wallet)
|
|
102
|
+
* ```ts
|
|
103
|
+
* const result = await hm.execute({
|
|
104
|
+
* fromChain: 900000003, // Tron
|
|
105
|
+
* fromToken: "...",
|
|
106
|
+
* fromAmount: "10000000",
|
|
107
|
+
* toChain: 900000002, // TON
|
|
108
|
+
* toToken: "...",
|
|
109
|
+
* fromAddress: "T...",
|
|
110
|
+
* toAddress: "EQ...",
|
|
111
|
+
* depositMode: "manual", // Force manual mode
|
|
112
|
+
* });
|
|
113
|
+
* // Show result.depositAddress to user with QR code
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
execute(params: ExecuteParams): Promise<ExecuteResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Submit a deposit transaction hash after sending tokens to a Near Intents deposit address.
|
|
119
|
+
* Only needed for `depositMode: "wallet"`. Manual deposits are auto-detected.
|
|
120
|
+
*/
|
|
121
|
+
submitDeposit(params: DepositSubmitParams): Promise<DepositSubmitResponse>;
|
|
122
|
+
/**
|
|
123
|
+
* Check the status of a Near Intents deposit/swap.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const status = await hm.getDepositStatus({
|
|
128
|
+
* depositAddress: "0x...",
|
|
129
|
+
* });
|
|
130
|
+
* if (status.status === "SUCCESS") {
|
|
131
|
+
* console.log("Swap complete!", status.swapDetails);
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
getDepositStatus(params: DepositStatusParams): Promise<DepositStatusResponse>;
|
|
136
|
+
/**
|
|
137
|
+
* Get a fiat → crypto price quote.
|
|
138
|
+
*/
|
|
139
|
+
getOnrampQuote(params: OnrampQuoteParams): Promise<unknown>;
|
|
140
|
+
/**
|
|
141
|
+
* Create a fiat → crypto purchase session. Returns a redirect URL
|
|
142
|
+
* to the payment page.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* const { redirectUrl, orderUid } = await hm.createOnrampCheckout({
|
|
147
|
+
* walletAddress: "0x...",
|
|
148
|
+
* cryptoToken: "ETH",
|
|
149
|
+
* cryptoChain: "ethereum",
|
|
150
|
+
* fiatCurrency: "USD",
|
|
151
|
+
* fiatAmount: 100,
|
|
152
|
+
* });
|
|
153
|
+
* // Redirect user to redirectUrl
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
createOnrampCheckout(params: OnrampCheckoutParams): Promise<OnrampCheckoutResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Check on-ramp order status.
|
|
159
|
+
*/
|
|
160
|
+
getOnrampStatus(orderUid: string): Promise<OnrampStatusResponse>;
|
|
161
|
+
/**
|
|
162
|
+
* Get supported chains and tokens for on-ramp.
|
|
163
|
+
* Cached server-side for 5 minutes.
|
|
164
|
+
*/
|
|
165
|
+
getOnrampConfig(): Promise<OnrampConfigResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* Get asset config (min/max amounts, precision, payment methods).
|
|
168
|
+
*/
|
|
169
|
+
getOnrampAssets(params: OnrampAssetsParams): Promise<unknown>;
|
|
170
|
+
/**
|
|
171
|
+
* Record a swap event for analytics. partner_id is automatically
|
|
172
|
+
* attributed from your API key.
|
|
173
|
+
*/
|
|
174
|
+
recordSwapEvent(params: SwapEventParams): Promise<SwapEventResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Get your partner info (requires API key).
|
|
177
|
+
*/
|
|
178
|
+
getPartnerInfo(): Promise<PartnerInfo>;
|
|
179
|
+
/**
|
|
180
|
+
* Get volume, fee, and performance stats (requires API key).
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const stats = await hm.getPartnerStats({
|
|
185
|
+
* from: "2025-01-01",
|
|
186
|
+
* to: "2025-03-31",
|
|
187
|
+
* });
|
|
188
|
+
* console.log(`Volume: $${stats.volume_usd}`);
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
getPartnerStats(params?: PartnerStatsParams): Promise<PartnerStats>;
|
|
192
|
+
/**
|
|
193
|
+
* Get paginated transaction history (requires API key).
|
|
194
|
+
*/
|
|
195
|
+
getPartnerTransactions(params?: PaginationParams): Promise<PaginatedResponse<Transaction>>;
|
|
196
|
+
/**
|
|
197
|
+
* Register a webhook endpoint. Returns the signing secret — store it securely!
|
|
198
|
+
* The secret is only shown once, on creation.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* const webhook = await hm.createWebhook({
|
|
203
|
+
* url: "https://myapp.com/webhooks/hypermid",
|
|
204
|
+
* events: ["swap.completed", "onramp.completed"],
|
|
205
|
+
* });
|
|
206
|
+
* // Store webhook.secret securely!
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
createWebhook(params: CreateWebhookParams): Promise<WebhookCreated>;
|
|
210
|
+
/**
|
|
211
|
+
* List all registered webhooks (requires API key).
|
|
212
|
+
* Note: webhook secrets are never returned in list responses.
|
|
213
|
+
*/
|
|
214
|
+
listWebhooks(): Promise<WebhooksListResponse>;
|
|
215
|
+
/**
|
|
216
|
+
* Delete a webhook by ID (requires API key).
|
|
217
|
+
*/
|
|
218
|
+
deleteWebhook(webhookId: string): Promise<{
|
|
219
|
+
deleted: boolean;
|
|
220
|
+
id: string;
|
|
221
|
+
}>;
|
|
222
|
+
/**
|
|
223
|
+
* Get token balances for a wallet address across chains.
|
|
224
|
+
* Uses Alchemy Portfolio API + PulseChain RPC + Blockstream (BTC) on the backend.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* const balances = await hm.getBalances({
|
|
229
|
+
* address: "0x1234...",
|
|
230
|
+
* chainIds: [1, 42161, 8453, 369],
|
|
231
|
+
* });
|
|
232
|
+
* console.log(balances.totalBalanceUSD);
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
getBalances(params: BalancesParams): Promise<BalancesResponse>;
|
|
236
|
+
/**
|
|
237
|
+
* Register a USDC deposit at the InboundReceiver contract for SuperSwap.
|
|
238
|
+
* Call this AFTER the user's bridge transaction confirms on-chain.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```ts
|
|
242
|
+
* const result = await hm.registerInboundReceiver({
|
|
243
|
+
* txHash: "0xabc...",
|
|
244
|
+
* fromChain: 8453,
|
|
245
|
+
* toChain: 369,
|
|
246
|
+
* receiverAddress: "0xuser...",
|
|
247
|
+
* outputToken: "0x0000...0000", // PLS
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
registerInboundReceiver(params: InboundReceiverParams): Promise<InboundReceiverResponse>;
|
|
252
|
+
/**
|
|
253
|
+
* Simple health check. Returns API status, version, uptime, and provider statuses.
|
|
254
|
+
*/
|
|
255
|
+
ping(): Promise<PingResponse>;
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,c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