@dubsdotapp/expo 0.2.15 → 0.2.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -167,11 +167,13 @@ export class DeeplinkHandler {
167
167
  }
168
168
  }
169
169
 
170
- /** Try to extract a request ID from the URL path segment after the redirect base. */
170
+ /** Extract the request ID from the dubs_rid query parameter. */
171
171
  private extractRequestId(url: string): string | null {
172
- const afterBase = url.slice(this.redirectBase.length);
173
- // Expected format: /requestId?params... or ?params...
174
- const match = afterBase.match(/^\/?([a-zA-Z0-9_-]+)/);
175
- return match?.[1] ?? null;
172
+ try {
173
+ const parsed = new URL(url);
174
+ return parsed.searchParams.get('dubs_rid');
175
+ } catch {
176
+ return null;
177
+ }
176
178
  }
177
179
  }
@@ -131,7 +131,7 @@ export class PhantomDeeplinkAdapter implements WalletAdapter {
131
131
  console.log(TAG, 'Dapp public key:', dappPubBase58);
132
132
 
133
133
  const requestId = nextRequestId();
134
- const redirectLink = `${this.config.redirectUri}/${requestId}`;
134
+ const redirectLink = `${this.config.redirectUri}?dubs_rid=${requestId}`;
135
135
  console.log(TAG, `connect() requestId=${requestId} redirectLink=${redirectLink}`);
136
136
 
137
137
  // app_url is required by Phantom — default to redirectUri if not provided
@@ -210,7 +210,7 @@ export class PhantomDeeplinkAdapter implements WalletAdapter {
210
210
  );
211
211
 
212
212
  const requestId = nextRequestId();
213
- const redirectLink = `${this.config.redirectUri}/${requestId}`;
213
+ const redirectLink = `${this.config.redirectUri}?dubs_rid=${requestId}`;
214
214
  console.log(TAG, `signTransaction() requestId=${requestId}`);
215
215
 
216
216
  const params = new URLSearchParams({
@@ -250,7 +250,7 @@ export class PhantomDeeplinkAdapter implements WalletAdapter {
250
250
  );
251
251
 
252
252
  const requestId = nextRequestId();
253
- const redirectLink = `${this.config.redirectUri}/${requestId}`;
253
+ const redirectLink = `${this.config.redirectUri}?dubs_rid=${requestId}`;
254
254
  console.log(TAG, `signAndSendTransaction() requestId=${requestId}`);
255
255
 
256
256
  const params = new URLSearchParams({
@@ -285,7 +285,7 @@ export class PhantomDeeplinkAdapter implements WalletAdapter {
285
285
  );
286
286
 
287
287
  const requestId = nextRequestId();
288
- const redirectLink = `${this.config.redirectUri}/${requestId}`;
288
+ const redirectLink = `${this.config.redirectUri}?dubs_rid=${requestId}`;
289
289
  console.log(TAG, `signMessage() requestId=${requestId}`);
290
290
 
291
291
  const params = new URLSearchParams({