shogun-relay-sdk 1.1.3 → 1.1.4
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/dist/modules/bridge.d.ts +52 -0
- package/dist/modules/bridge.js +18 -0
- package/package.json +1 -1
package/dist/modules/bridge.d.ts
CHANGED
|
@@ -214,4 +214,56 @@ export declare class BridgeModule {
|
|
|
214
214
|
message: string;
|
|
215
215
|
error?: string;
|
|
216
216
|
}>;
|
|
217
|
+
/**
|
|
218
|
+
* Get all transactions (deposits, withdrawals, transfers) for a user
|
|
219
|
+
* Returns a unified list of all transaction types sorted by timestamp
|
|
220
|
+
* @param userAddress User's Ethereum address
|
|
221
|
+
* @returns Transaction history
|
|
222
|
+
*/
|
|
223
|
+
getTransactions(userAddress: string): Promise<{
|
|
224
|
+
success: boolean;
|
|
225
|
+
user: string;
|
|
226
|
+
transactions: Array<{
|
|
227
|
+
type: 'deposit' | 'withdrawal' | 'transfer';
|
|
228
|
+
txHash: string;
|
|
229
|
+
from?: string;
|
|
230
|
+
to?: string;
|
|
231
|
+
amount: string;
|
|
232
|
+
amountEth: string;
|
|
233
|
+
timestamp: number;
|
|
234
|
+
blockNumber?: number;
|
|
235
|
+
nonce?: string;
|
|
236
|
+
batchId?: string;
|
|
237
|
+
status: 'pending' | 'completed' | 'batched';
|
|
238
|
+
}>;
|
|
239
|
+
count: number;
|
|
240
|
+
summary: {
|
|
241
|
+
deposits: number;
|
|
242
|
+
withdrawals: number;
|
|
243
|
+
transfers: number;
|
|
244
|
+
};
|
|
245
|
+
}>;
|
|
246
|
+
/**
|
|
247
|
+
* Get detailed information about a specific transaction by hash
|
|
248
|
+
* Searches across deposits, withdrawals, and transfers
|
|
249
|
+
* @param txHash Transaction hash
|
|
250
|
+
* @returns Transaction details
|
|
251
|
+
*/
|
|
252
|
+
getTransaction(txHash: string): Promise<{
|
|
253
|
+
success: boolean;
|
|
254
|
+
transaction?: {
|
|
255
|
+
type: 'deposit' | 'withdrawal' | 'transfer';
|
|
256
|
+
txHash: string;
|
|
257
|
+
from?: string;
|
|
258
|
+
to?: string;
|
|
259
|
+
amount: string;
|
|
260
|
+
amountEth: string;
|
|
261
|
+
timestamp: number;
|
|
262
|
+
blockNumber?: number;
|
|
263
|
+
nonce?: string;
|
|
264
|
+
status: 'pending' | 'completed' | 'batched';
|
|
265
|
+
};
|
|
266
|
+
source?: 'deposit' | 'withdrawal' | 'transfer';
|
|
267
|
+
error?: string;
|
|
268
|
+
}>;
|
|
217
269
|
}
|
package/dist/modules/bridge.js
CHANGED
|
@@ -106,5 +106,23 @@ class BridgeModule {
|
|
|
106
106
|
async reconcileBalance(userAddress) {
|
|
107
107
|
return this.client.post('/api/v1/bridge/reconcile-balance', { user: userAddress });
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Get all transactions (deposits, withdrawals, transfers) for a user
|
|
111
|
+
* Returns a unified list of all transaction types sorted by timestamp
|
|
112
|
+
* @param userAddress User's Ethereum address
|
|
113
|
+
* @returns Transaction history
|
|
114
|
+
*/
|
|
115
|
+
async getTransactions(userAddress) {
|
|
116
|
+
return this.client.get(`/api/v1/bridge/transactions/${userAddress}`);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Get detailed information about a specific transaction by hash
|
|
120
|
+
* Searches across deposits, withdrawals, and transfers
|
|
121
|
+
* @param txHash Transaction hash
|
|
122
|
+
* @returns Transaction details
|
|
123
|
+
*/
|
|
124
|
+
async getTransaction(txHash) {
|
|
125
|
+
return this.client.get(`/api/v1/bridge/transaction/${txHash}`);
|
|
126
|
+
}
|
|
109
127
|
}
|
|
110
128
|
exports.BridgeModule = BridgeModule;
|
package/package.json
CHANGED