shogun-relay-sdk 1.0.1 → 1.0.3

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.
@@ -5,6 +5,7 @@ export interface PendingWithdrawal {
5
5
  nonce: string;
6
6
  timestamp: number;
7
7
  txHash?: string;
8
+ debitHash?: string;
8
9
  }
9
10
  export interface BridgeState {
10
11
  currentStateRoot: string;
@@ -41,6 +42,8 @@ export interface BatchResult {
41
42
  batchId: string;
42
43
  root: string;
43
44
  withdrawalCount: number;
45
+ verifiedCount?: number;
46
+ excludedCount?: number;
44
47
  txHash: string;
45
48
  blockNumber: number;
46
49
  }
@@ -143,4 +146,46 @@ export declare class BridgeModule {
143
146
  amount: string;
144
147
  instructions: string;
145
148
  }>;
149
+ /**
150
+ * Retroactively sync missed deposits from a block range
151
+ * Useful if the relay missed some deposits due to downtime or errors
152
+ * @param params Sync parameters
153
+ * @returns Sync results
154
+ */
155
+ syncDeposits(params?: {
156
+ fromBlock?: number;
157
+ toBlock?: number | 'latest';
158
+ user?: string;
159
+ }): Promise<{
160
+ success: boolean;
161
+ results: {
162
+ total: number;
163
+ processed: number;
164
+ skipped: number;
165
+ failed: number;
166
+ errors: string[];
167
+ };
168
+ }>;
169
+ /**
170
+ * Force process a specific deposit by transaction hash
171
+ * Useful for manually recovering a missed deposit
172
+ * @param txHash Transaction hash of the deposit
173
+ * @returns Deposit processing result
174
+ */
175
+ processDeposit(txHash: string): Promise<{
176
+ success: boolean;
177
+ deposit?: {
178
+ txHash: string;
179
+ user: string;
180
+ amount: string;
181
+ amountEth: string;
182
+ blockNumber: number;
183
+ };
184
+ balance?: {
185
+ wei: string;
186
+ eth: string;
187
+ };
188
+ message?: string;
189
+ error?: string;
190
+ }>;
146
191
  }
@@ -70,5 +70,23 @@ class BridgeModule {
70
70
  async getDepositInstructions(amount) {
71
71
  return this.client.post('/api/v1/bridge/deposit', { amount });
72
72
  }
73
+ /**
74
+ * Retroactively sync missed deposits from a block range
75
+ * Useful if the relay missed some deposits due to downtime or errors
76
+ * @param params Sync parameters
77
+ * @returns Sync results
78
+ */
79
+ async syncDeposits(params) {
80
+ return this.client.post('/api/v1/bridge/sync-deposits', params || {});
81
+ }
82
+ /**
83
+ * Force process a specific deposit by transaction hash
84
+ * Useful for manually recovering a missed deposit
85
+ * @param txHash Transaction hash of the deposit
86
+ * @returns Deposit processing result
87
+ */
88
+ async processDeposit(txHash) {
89
+ return this.client.post('/api/v1/bridge/process-deposit', { txHash });
90
+ }
73
91
  }
74
92
  exports.BridgeModule = BridgeModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shogun-relay-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "SDK for interacting with Shogun Relay API - HTTP client for IPFS, deals, registry, and network operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",