@oobit/react-native-sdk 2.0.2 → 3.0.1
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 +19 -341
- package/dist/WidgetSDK.d.ts +0 -2
- package/dist/WidgetSDK.d.ts.map +1 -1
- package/dist/WidgetSDK.js +25 -127
- package/dist/WidgetSDK.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +41 -148
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -33
- package/dist/types.js.map +1 -1
- package/dist/walletUtils.d.ts.map +1 -1
- package/dist/walletUtils.js +16 -64
- package/dist/walletUtils.js.map +1 -1
- package/package.json +1 -10
- package/src/WidgetSDK.tsx +26 -153
- package/src/index.ts +7 -9
- package/src/types.ts +42 -207
- package/src/walletUtils.ts +27 -42
package/dist/types.d.ts
CHANGED
|
@@ -1,147 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Messages that can be sent between the web widget and React Native
|
|
2
|
+
* Token metadata included with transaction requests
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
* Token information for transaction confirmation
|
|
7
|
-
* Minimal fields needed to display a send transaction confirmation page
|
|
8
|
-
*/
|
|
9
|
-
export interface DepositToken {
|
|
4
|
+
export interface TransactionTokenMetadata {
|
|
10
5
|
symbol: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
chainId: number;
|
|
6
|
+
amount: string;
|
|
7
|
+
decimals: number;
|
|
14
8
|
}
|
|
15
|
-
export type WidgetMessageType = "widget:ready" | "widget:open-wallet" | "widget:error" | "widget:close" | "widget:transaction-requested" | "widget:token-expired" | "widget:request-card-details-session" | "widget:copy-to-clipboard";
|
|
16
9
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Messages sent from the native app to the web widget
|
|
10
|
+
* EVM transaction data
|
|
19
11
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
export interface NativeNavigateBackMessage {
|
|
26
|
-
type: "native:navigate-back";
|
|
27
|
-
timestamp: number;
|
|
28
|
-
}
|
|
29
|
-
export interface NativePlatformInfoMessage {
|
|
30
|
-
type: "native:platform-info";
|
|
31
|
-
payload: {
|
|
32
|
-
platform: "ios" | "android";
|
|
33
|
-
walletAvailable: boolean;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface NativeWalletOpenedMessage {
|
|
37
|
-
type: "native:wallet-opened";
|
|
38
|
-
payload: {
|
|
39
|
-
success: boolean;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export interface NativeCardDetailsSessionMessage {
|
|
43
|
-
type: "native:card-details-session";
|
|
44
|
-
payload: {
|
|
45
|
-
sessionId: string;
|
|
46
|
-
secretKey: string;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export interface NativeBiometricFailedMessage {
|
|
50
|
-
type: "native:biometric-failed";
|
|
51
|
-
payload: {
|
|
52
|
-
reason: "cancelled" | "failed" | "not_available" | "not_enrolled";
|
|
53
|
-
message?: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export interface NativeClipboardResultMessage {
|
|
57
|
-
type: "native:clipboard-result";
|
|
58
|
-
payload: {
|
|
59
|
-
success: boolean;
|
|
60
|
-
label?: string;
|
|
61
|
-
error?: string;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export type NativeMessage = NativeBackPressedMessage | NativeNavigateBackMessage | NativePlatformInfoMessage | NativeWalletOpenedMessage | NativeCardDetailsSessionMessage | NativeBiometricFailedMessage | NativeClipboardResultMessage;
|
|
65
|
-
export interface BaseWidgetMessage {
|
|
66
|
-
type: WidgetMessageType;
|
|
67
|
-
timestamp: number;
|
|
68
|
-
}
|
|
69
|
-
export interface WidgetReadyMessage extends BaseWidgetMessage {
|
|
70
|
-
type: "widget:ready";
|
|
71
|
-
}
|
|
72
|
-
export interface OpenWalletMessage extends BaseWidgetMessage {
|
|
73
|
-
type: "widget:open-wallet";
|
|
74
|
-
payload: {
|
|
75
|
-
platform: "ios" | "android";
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
export interface WidgetErrorMessage extends BaseWidgetMessage {
|
|
79
|
-
type: "widget:error";
|
|
80
|
-
payload: {
|
|
81
|
-
code: string;
|
|
82
|
-
message: string;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export interface WidgetCloseMessage extends BaseWidgetMessage {
|
|
86
|
-
type: "widget:close";
|
|
87
|
-
}
|
|
88
|
-
export interface TransactionRequestedMessage extends BaseWidgetMessage {
|
|
89
|
-
type: "widget:transaction-requested";
|
|
90
|
-
payload: {
|
|
91
|
-
token: DepositToken;
|
|
92
|
-
cryptoAmount: string;
|
|
93
|
-
depositAddress: string;
|
|
94
|
-
depositAddressTag: string | null;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export interface TokenExpiredMessage extends BaseWidgetMessage {
|
|
98
|
-
type: "widget:token-expired";
|
|
99
|
-
payload?: {
|
|
100
|
-
reason?: string;
|
|
101
|
-
};
|
|
12
|
+
export interface EvmTransactionData {
|
|
13
|
+
to: string;
|
|
14
|
+
data: string;
|
|
15
|
+
value: string;
|
|
102
16
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
17
|
+
/**
|
|
18
|
+
* EVM transaction request payload
|
|
19
|
+
*/
|
|
20
|
+
export interface EvmTransactionRequest {
|
|
21
|
+
type: "evm";
|
|
22
|
+
chainId: number;
|
|
23
|
+
transaction: EvmTransactionData;
|
|
24
|
+
tokenMetadata: TransactionTokenMetadata;
|
|
108
25
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Solana transaction request payload
|
|
28
|
+
*/
|
|
29
|
+
export interface SolanaTransactionRequest {
|
|
30
|
+
type: "solana";
|
|
31
|
+
transaction: string;
|
|
32
|
+
tokenMetadata: TransactionTokenMetadata;
|
|
115
33
|
}
|
|
116
|
-
export type WidgetMessage = WidgetReadyMessage | OpenWalletMessage | WidgetErrorMessage | WidgetCloseMessage | TransactionRequestedMessage | TokenExpiredMessage | RequestCardDetailsSessionMessage | CopyToClipboardMessage;
|
|
117
34
|
/**
|
|
118
|
-
*
|
|
119
|
-
* - TOKEN_EXPIRED: The access token has expired
|
|
120
|
-
* - PARSE_ERROR: Failed to parse a message from the widget
|
|
121
|
-
* - WEBVIEW_ERROR: The WebView failed to load
|
|
35
|
+
* Transaction request payload
|
|
122
36
|
*/
|
|
123
|
-
export type
|
|
37
|
+
export type TransactionRequest = EvmTransactionRequest | SolanaTransactionRequest;
|
|
124
38
|
/**
|
|
125
39
|
* SDK Configuration
|
|
126
40
|
*/
|
|
127
41
|
export interface WidgetSDKConfig {
|
|
128
42
|
accessToken: string;
|
|
129
43
|
userWalletAddress: string;
|
|
130
|
-
/**
|
|
131
|
-
* Called when an error occurs
|
|
132
|
-
*/
|
|
133
|
-
onError?: (code: SDKErrorCode | string, message: string) => void;
|
|
134
|
-
/**
|
|
135
|
-
* Called when the widget requests to close
|
|
136
|
-
*/
|
|
137
44
|
onClose?: () => void;
|
|
138
|
-
|
|
139
|
-
* Called when a crypto transaction is requested
|
|
140
|
-
*/
|
|
141
|
-
onTransactionRequested: (token: DepositToken, cryptoAmount: string, depositAddress: string, depositAddressTag: string | null) => void;
|
|
45
|
+
onTransactionRequested: (transaction: TransactionRequest) => void;
|
|
142
46
|
}
|
|
143
47
|
/**
|
|
144
|
-
*
|
|
48
|
+
* Internal: Messages from widget
|
|
49
|
+
*/
|
|
50
|
+
export type WidgetMessage = {
|
|
51
|
+
type: "widget:ready";
|
|
52
|
+
} | {
|
|
53
|
+
type: "widget:open-wallet";
|
|
54
|
+
} | {
|
|
55
|
+
type: "widget:close";
|
|
56
|
+
} | {
|
|
57
|
+
type: "widget:transaction-requested";
|
|
58
|
+
payload: TransactionRequest;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Internal: Wallet URLs
|
|
145
62
|
*/
|
|
146
63
|
export declare const WALLET_URLS: {
|
|
147
64
|
readonly ios: {
|
|
@@ -153,28 +70,4 @@ export declare const WALLET_URLS: {
|
|
|
153
70
|
readonly fallback: "https://wallet.google.com";
|
|
154
71
|
};
|
|
155
72
|
};
|
|
156
|
-
/**
|
|
157
|
-
* Message type constants that clients can use
|
|
158
|
-
* @example
|
|
159
|
-
* if (message.type === MessageTypes.READY) {
|
|
160
|
-
* // Handle ready
|
|
161
|
-
* }
|
|
162
|
-
*/
|
|
163
|
-
export declare const MessageTypes: {
|
|
164
|
-
readonly READY: "widget:ready";
|
|
165
|
-
readonly OPEN_WALLET: "widget:open-wallet";
|
|
166
|
-
readonly ERROR: "widget:error";
|
|
167
|
-
readonly CLOSE: "widget:close";
|
|
168
|
-
readonly TRANSACTION_REQUESTED: "widget:transaction-requested";
|
|
169
|
-
readonly TOKEN_EXPIRED: "widget:token-expired";
|
|
170
|
-
readonly REQUEST_CARD_DETAILS_SESSION: "widget:request-card-details-session";
|
|
171
|
-
readonly COPY_TO_CLIPBOARD: "widget:copy-to-clipboard";
|
|
172
|
-
readonly PLATFORM_INFO: "native:platform-info";
|
|
173
|
-
readonly WALLET_OPENED: "native:wallet-opened";
|
|
174
|
-
readonly BACK_PRESSED: "native:back-pressed";
|
|
175
|
-
readonly NAVIGATE_BACK: "native:navigate-back";
|
|
176
|
-
readonly CARD_DETAILS_SESSION: "native:card-details-session";
|
|
177
|
-
readonly BIOMETRIC_FAILED: "native:biometric-failed";
|
|
178
|
-
readonly CLIPBOARD_RESULT: "native:clipboard-result";
|
|
179
|
-
};
|
|
180
73
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,wBAAwB,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,wBAAwB,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,qBAAqB,GACrB,wBAAwB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sBAAsB,EAAE,CAAC,WAAW,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,8BAA8B,CAAC;IAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;CASd,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Widget SDK Types
|
|
4
|
-
* Messages that can be sent between the web widget and React Native
|
|
5
|
-
*/
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
3
|
+
exports.WALLET_URLS = void 0;
|
|
8
4
|
/**
|
|
9
|
-
*
|
|
5
|
+
* Internal: Wallet URLs
|
|
10
6
|
*/
|
|
11
7
|
exports.WALLET_URLS = {
|
|
12
8
|
ios: {
|
|
13
|
-
passkit: "shoebox://",
|
|
9
|
+
passkit: "shoebox://",
|
|
14
10
|
fallback: "https://wallet.apple.com",
|
|
15
11
|
},
|
|
16
12
|
android: {
|
|
@@ -18,30 +14,4 @@ exports.WALLET_URLS = {
|
|
|
18
14
|
fallback: "https://wallet.google.com",
|
|
19
15
|
},
|
|
20
16
|
};
|
|
21
|
-
/**
|
|
22
|
-
* Message type constants that clients can use
|
|
23
|
-
* @example
|
|
24
|
-
* if (message.type === MessageTypes.READY) {
|
|
25
|
-
* // Handle ready
|
|
26
|
-
* }
|
|
27
|
-
*/
|
|
28
|
-
exports.MessageTypes = {
|
|
29
|
-
// Widget → Native
|
|
30
|
-
READY: "widget:ready",
|
|
31
|
-
OPEN_WALLET: "widget:open-wallet",
|
|
32
|
-
ERROR: "widget:error",
|
|
33
|
-
CLOSE: "widget:close",
|
|
34
|
-
TRANSACTION_REQUESTED: "widget:transaction-requested",
|
|
35
|
-
TOKEN_EXPIRED: "widget:token-expired",
|
|
36
|
-
REQUEST_CARD_DETAILS_SESSION: "widget:request-card-details-session",
|
|
37
|
-
COPY_TO_CLIPBOARD: "widget:copy-to-clipboard",
|
|
38
|
-
// Native → Widget
|
|
39
|
-
PLATFORM_INFO: "native:platform-info",
|
|
40
|
-
WALLET_OPENED: "native:wallet-opened",
|
|
41
|
-
BACK_PRESSED: "native:back-pressed",
|
|
42
|
-
NAVIGATE_BACK: "native:navigate-back",
|
|
43
|
-
CARD_DETAILS_SESSION: "native:card-details-session",
|
|
44
|
-
BIOMETRIC_FAILED: "native:biometric-failed",
|
|
45
|
-
CLIPBOARD_RESULT: "native:clipboard-result",
|
|
46
|
-
};
|
|
47
17
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA+DA;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,GAAG,EAAE;QACH,OAAO,EAAE,YAAY;QACrB,QAAQ,EAAE,0BAA0B;KACrC;IACD,OAAO,EAAE;QACP,SAAS,EAAE,yCAAyC;QACpD,QAAQ,EAAE,2BAA2B;KACtC;CACO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletUtils.d.ts","sourceRoot":"","sources":["../src/walletUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"walletUtils.d.ts","sourceRoot":"","sources":["../src/walletUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,OAAO,CAkBxD,CAAC;AA6GF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,OAAO,CAYzD,CAAC"}
|
package/dist/walletUtils.js
CHANGED
|
@@ -3,42 +3,8 @@
|
|
|
3
3
|
* Wallet Integration Utilities
|
|
4
4
|
* Handles opening Apple Wallet (iOS) and Google Wallet (Android)
|
|
5
5
|
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
7
|
exports.isWalletAvailable = exports.openNativeWallet = void 0;
|
|
41
|
-
const IntentLauncher = __importStar(require("expo-intent-launcher"));
|
|
42
8
|
const react_native_1 = require("react-native");
|
|
43
9
|
const types_1 = require("./types");
|
|
44
10
|
/**
|
|
@@ -115,14 +81,13 @@ const openAppleWallet = async () => {
|
|
|
115
81
|
};
|
|
116
82
|
/**
|
|
117
83
|
* Opens Google Wallet on Android
|
|
118
|
-
*
|
|
84
|
+
* Uses Linking API to launch the app or fall back to Play Store
|
|
119
85
|
*/
|
|
120
86
|
const openGoogleWallet = async () => {
|
|
121
87
|
const GOOGLE_WALLET_PACKAGE = "com.google.android.apps.walletnfcrel";
|
|
122
88
|
try {
|
|
123
89
|
console.log("Attempting to open Google Wallet...");
|
|
124
|
-
//
|
|
125
|
-
// This is the most reliable way to open an installed app without knowing the exact activity
|
|
90
|
+
// Try using the market:// scheme to launch the app if it's installed
|
|
126
91
|
try {
|
|
127
92
|
const canOpen = await react_native_1.Linking.canOpenURL(`market://launch?id=${GOOGLE_WALLET_PACKAGE}`);
|
|
128
93
|
console.log("Can open market launch URL:", canOpen);
|
|
@@ -133,36 +98,23 @@ const openGoogleWallet = async () => {
|
|
|
133
98
|
}
|
|
134
99
|
}
|
|
135
100
|
catch (marketLaunchError) {
|
|
136
|
-
console.log("Market launch failed
|
|
101
|
+
console.log("Market launch failed:", marketLaunchError);
|
|
137
102
|
}
|
|
138
|
-
//
|
|
139
|
-
|
|
103
|
+
// App is not installed or market:// not available, open Play Store
|
|
104
|
+
console.log("Opening Play Store to install Google Wallet");
|
|
140
105
|
try {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return true;
|
|
106
|
+
// Try native Play Store app first
|
|
107
|
+
const playStoreUrl = `market://details?id=${GOOGLE_WALLET_PACKAGE}`;
|
|
108
|
+
await react_native_1.Linking.openURL(playStoreUrl);
|
|
109
|
+
react_native_1.Alert.alert("Google Wallet", "Google Wallet is not installed. Opening Play Store to install the app.");
|
|
110
|
+
return false;
|
|
147
111
|
}
|
|
148
|
-
catch (
|
|
149
|
-
console.log("
|
|
150
|
-
//
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const playStoreUrl = `market://details?id=${GOOGLE_WALLET_PACKAGE}`;
|
|
155
|
-
await react_native_1.Linking.openURL(playStoreUrl);
|
|
156
|
-
react_native_1.Alert.alert("Google Wallet", "Google Wallet is not installed. Opening Play Store to install the app.");
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
catch (marketError) {
|
|
160
|
-
console.log("Market URL failed, trying web Play Store:", marketError);
|
|
161
|
-
// Fallback to web Play Store
|
|
162
|
-
await react_native_1.Linking.openURL(`https://play.google.com/store/apps/details?id=${GOOGLE_WALLET_PACKAGE}`);
|
|
163
|
-
react_native_1.Alert.alert("Google Wallet", "Google Wallet is not installed. Opening Play Store to install the app.");
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
112
|
+
catch (marketError) {
|
|
113
|
+
console.log("Market URL failed, trying web Play Store:", marketError);
|
|
114
|
+
// Fallback to web Play Store
|
|
115
|
+
await react_native_1.Linking.openURL(`https://play.google.com/store/apps/details?id=${GOOGLE_WALLET_PACKAGE}`);
|
|
116
|
+
react_native_1.Alert.alert("Google Wallet", "Google Wallet is not installed. Opening Play Store to install the app.");
|
|
117
|
+
return false;
|
|
166
118
|
}
|
|
167
119
|
}
|
|
168
120
|
catch (error) {
|
package/dist/walletUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletUtils.js","sourceRoot":"","sources":["../src/walletUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"walletUtils.js","sourceRoot":"","sources":["../src/walletUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAwD;AACxD,mCAAsC;AAEtC;;;GAGG;AACI,MAAM,gBAAgB,GAAG,KAAK,IAAsB,EAAE;IAC3D,IAAI,CAAC;QACH,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,MAAM,eAAe,EAAE,CAAC;QACjC,CAAC;aAAM,IAAI,uBAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YACrC,OA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AAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,iBAAiB,qBAY5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oobit/react-native-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "React Native SDK for integrating Oobit crypto payments into wallet apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"keywords": [
|
|
20
20
|
"react-native",
|
|
21
|
-
"expo",
|
|
22
21
|
"crypto",
|
|
23
22
|
"payments",
|
|
24
23
|
"wallet",
|
|
@@ -39,10 +38,6 @@
|
|
|
39
38
|
"url": "git+https://github.com/oobit-tech/react-native-SDK.git"
|
|
40
39
|
},
|
|
41
40
|
"peerDependencies": {
|
|
42
|
-
"expo-clipboard": ">=5.0.0",
|
|
43
|
-
"expo-intent-launcher": ">=6.0.0",
|
|
44
|
-
"expo-linking": ">=6.0.0",
|
|
45
|
-
"expo-local-authentication": ">=14.0.0",
|
|
46
41
|
"react": ">=18.0.0",
|
|
47
42
|
"react-native": ">=0.70.0",
|
|
48
43
|
"react-native-webview": ">=13.0.0"
|
|
@@ -56,10 +51,6 @@
|
|
|
56
51
|
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
|
57
52
|
"@typescript-eslint/parser": "^8.47.0",
|
|
58
53
|
"eslint": "^9.39.1",
|
|
59
|
-
"expo-clipboard": "~8.0.8",
|
|
60
|
-
"expo-intent-launcher": "~13.0.7",
|
|
61
|
-
"expo-linking": "~8.0.8",
|
|
62
|
-
"expo-local-authentication": "~15.0.2",
|
|
63
54
|
"react": "19.1.0",
|
|
64
55
|
"react-native": "0.81.5",
|
|
65
56
|
"react-native-webview": "13.15.0",
|