@coinflowlabs/react 5.9.1 → 5.10.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 +8 -0
- package/build/cjs/CoinflowApplePayButton.d.ts +1 -1
- package/build/cjs/CoinflowApplePayButton.js +5 -6
- package/build/cjs/CoinflowApplePayButton.js.map +1 -1
- package/build/cjs/CoinflowGooglePayButton.js +4 -5
- package/build/cjs/CoinflowGooglePayButton.js.map +1 -1
- package/build/cjs/CoinflowIFrame.js +42 -53
- package/build/cjs/CoinflowIFrame.js.map +1 -1
- package/build/cjs/CoinflowPurchase.js +55 -42
- package/build/cjs/CoinflowPurchase.js.map +1 -1
- package/build/cjs/CoinflowPurchaseHistory.js +20 -11
- package/build/cjs/CoinflowPurchaseHistory.js.map +1 -1
- package/build/cjs/CoinflowPurchaseProtection.d.ts +1 -1
- package/build/cjs/CoinflowPurchaseProtection.js +10 -11
- package/build/cjs/CoinflowPurchaseProtection.js.map +1 -1
- package/build/cjs/CoinflowWithdraw.js +20 -11
- package/build/cjs/CoinflowWithdraw.js.map +1 -1
- package/build/cjs/CoinflowWithdrawHistory.js +20 -11
- package/build/cjs/CoinflowWithdrawHistory.js.map +1 -1
- package/build/cjs/MobileWalletButton.d.ts +1 -1
- package/build/cjs/MobileWalletButton.js +35 -26
- package/build/cjs/MobileWalletButton.js.map +1 -1
- package/build/cjs/card-form/CoinflowCardForm.js +42 -54
- package/build/cjs/card-form/CoinflowCardForm.js.map +1 -1
- package/build/cjs/card-form/CoinflowCardFormHeader.js +5 -5
- package/build/cjs/card-form/CoinflowCardFormHeader.js.map +1 -1
- package/build/cjs/card-form/useCardFormIframe.d.ts +5 -5
- package/build/cjs/card-form/useCardFormIframe.js +57 -57
- package/build/cjs/card-form/useCardFormIframe.js.map +1 -1
- package/build/cjs/common/CoinflowLibMessageHandlers.d.ts +2 -1
- package/build/cjs/common/CoinflowLibMessageHandlers.js +128 -193
- package/build/cjs/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/cjs/common/CoinflowTypes.d.ts +19 -8
- package/build/cjs/common/CoinflowTypes.js +15 -16
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +2 -1
- package/build/cjs/common/CoinflowUtils.js +68 -64
- package/build/cjs/common/CoinflowUtils.js.map +1 -1
- package/build/cjs/common/EventBus.js +8 -11
- package/build/cjs/common/EventBus.js.map +1 -1
- package/build/cjs/common/NSure.js +2 -2
- package/build/cjs/common/NSure.js.map +1 -1
- package/build/cjs/common/NSure.native.js.map +1 -1
- package/build/cjs/common/SolanaPeerDeps.js +5 -5
- package/build/cjs/common/SolanaPeerDeps.js.map +1 -1
- package/build/cjs/common/card-form/TokenEx.js +7 -8
- package/build/cjs/common/card-form/TokenEx.js.map +1 -1
- package/build/cjs/common/card-form/tokenexHelpers.d.ts +1 -1
- package/build/cjs/common/card-form/tokenexHelpers.js +97 -150
- package/build/cjs/common/card-form/tokenexHelpers.js.map +1 -1
- package/build/cjs/common/index.js +1 -1
- package/build/cjs/common/types/Subtotal.js +175 -176
- package/build/cjs/common/types/Subtotal.js.map +1 -1
- package/build/cjs/common/types/nftCartItem.js +2 -2
- package/build/cjs/common/types/nftCartItem.js.map +1 -1
- package/build/cjs/index.js +1 -1
- package/build/cjs/useOverlay.js +13 -12
- package/build/cjs/useOverlay.js.map +1 -1
- package/build/esm/CoinflowApplePayButton.d.ts +1 -1
- package/build/esm/CoinflowApplePayButton.js +2 -3
- package/build/esm/CoinflowApplePayButton.js.map +1 -1
- package/build/esm/CoinflowGooglePayButton.js +1 -2
- package/build/esm/CoinflowGooglePayButton.js.map +1 -1
- package/build/esm/CoinflowIFrame.js +39 -51
- package/build/esm/CoinflowIFrame.js.map +1 -1
- package/build/esm/CoinflowPurchase.js +50 -38
- package/build/esm/CoinflowPurchase.js.map +1 -1
- package/build/esm/CoinflowPurchaseHistory.js +16 -8
- package/build/esm/CoinflowPurchaseHistory.js.map +1 -1
- package/build/esm/CoinflowPurchaseProtection.d.ts +1 -1
- package/build/esm/CoinflowPurchaseProtection.js +6 -7
- package/build/esm/CoinflowPurchaseProtection.js.map +1 -1
- package/build/esm/CoinflowWithdraw.js +16 -8
- package/build/esm/CoinflowWithdraw.js.map +1 -1
- package/build/esm/CoinflowWithdrawHistory.js +16 -8
- package/build/esm/CoinflowWithdrawHistory.js.map +1 -1
- package/build/esm/MobileWalletButton.d.ts +1 -1
- package/build/esm/MobileWalletButton.js +30 -22
- package/build/esm/MobileWalletButton.js.map +1 -1
- package/build/esm/card-form/CoinflowCardForm.js +41 -54
- package/build/esm/card-form/CoinflowCardForm.js.map +1 -1
- package/build/esm/card-form/CoinflowCardFormHeader.js +3 -3
- package/build/esm/card-form/CoinflowCardFormHeader.js.map +1 -1
- package/build/esm/card-form/useCardFormIframe.d.ts +5 -5
- package/build/esm/card-form/useCardFormIframe.js +56 -56
- package/build/esm/card-form/useCardFormIframe.js.map +1 -1
- package/build/esm/common/CoinflowLibMessageHandlers.d.ts +2 -1
- package/build/esm/common/CoinflowLibMessageHandlers.js +126 -191
- package/build/esm/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/esm/common/CoinflowTypes.d.ts +19 -8
- package/build/esm/common/CoinflowTypes.js +16 -17
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +2 -1
- package/build/esm/common/CoinflowUtils.js +63 -61
- package/build/esm/common/CoinflowUtils.js.map +1 -1
- package/build/esm/common/EventBus.js +8 -12
- package/build/esm/common/EventBus.js.map +1 -1
- package/build/esm/common/SolanaPeerDeps.js +2 -2
- package/build/esm/common/SolanaPeerDeps.js.map +1 -1
- package/build/esm/common/card-form/TokenEx.js +8 -9
- package/build/esm/common/card-form/TokenEx.js.map +1 -1
- package/build/esm/common/card-form/tokenexHelpers.d.ts +1 -1
- package/build/esm/common/card-form/tokenexHelpers.js +95 -148
- package/build/esm/common/card-form/tokenexHelpers.js.map +1 -1
- package/build/esm/common/types/Subtotal.js +175 -176
- package/build/esm/common/types/Subtotal.js.map +1 -1
- package/build/esm/common/types/nftCartItem.js +2 -2
- package/build/esm/common/types/nftCartItem.js.map +1 -1
- package/build/esm/useOverlay.js +11 -10
- package/build/esm/useOverlay.js.map +1 -1
- package/build/tsconfig.cjs.tsbuildinfo +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -4,9 +4,8 @@ exports.IFrameMessageMethods = void 0;
|
|
|
4
4
|
exports.getWalletPubkey = getWalletPubkey;
|
|
5
5
|
exports.handleIFrameMessage = handleIFrameMessage;
|
|
6
6
|
exports.getHandlers = getHandlers;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var SolanaPeerDeps_1 = require("./SolanaPeerDeps");
|
|
7
|
+
const CoinflowUtils_1 = require("./CoinflowUtils");
|
|
8
|
+
const SolanaPeerDeps_1 = require("./SolanaPeerDeps");
|
|
10
9
|
var IFrameMessageMethods;
|
|
11
10
|
(function (IFrameMessageMethods) {
|
|
12
11
|
IFrameMessageMethods["SignMessage"] = "signMessage";
|
|
@@ -17,9 +16,10 @@ var IFrameMessageMethods;
|
|
|
17
16
|
IFrameMessageMethods["AuthDeclined"] = "authDeclined";
|
|
18
17
|
IFrameMessageMethods["Loaded"] = "loaded";
|
|
19
18
|
IFrameMessageMethods["AccountLinked"] = "accountLinked";
|
|
19
|
+
IFrameMessageMethods["Redirect"] = "redirect";
|
|
20
20
|
})(IFrameMessageMethods || (exports.IFrameMessageMethods = IFrameMessageMethods = {}));
|
|
21
21
|
function getWalletPubkey(input) {
|
|
22
|
-
|
|
22
|
+
let wallet;
|
|
23
23
|
if ('signer' in input &&
|
|
24
24
|
typeof input.signer === 'object' &&
|
|
25
25
|
input.signer &&
|
|
@@ -40,7 +40,7 @@ function getWalletPubkey(input) {
|
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
function handleIFrameMessage(rawMessage, handlers, handleHeightChangeId) {
|
|
43
|
-
|
|
43
|
+
let walletCall;
|
|
44
44
|
try {
|
|
45
45
|
walletCall = JSON.parse(rawMessage);
|
|
46
46
|
if (!('method' in walletCall) || !('data' in walletCall))
|
|
@@ -50,7 +50,7 @@ function handleIFrameMessage(rawMessage, handlers, handleHeightChangeId) {
|
|
|
50
50
|
console.error('handleIFrameMessage JSON parse', e);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
const { data, method } = walletCall;
|
|
54
54
|
switch (method) {
|
|
55
55
|
case IFrameMessageMethods.SignMessage:
|
|
56
56
|
if (!handlers.handleSignMessage)
|
|
@@ -80,12 +80,15 @@ function handleIFrameMessage(rawMessage, handlers, handleHeightChangeId) {
|
|
|
80
80
|
return;
|
|
81
81
|
case IFrameMessageMethods.AccountLinked:
|
|
82
82
|
return;
|
|
83
|
+
case IFrameMessageMethods.Redirect:
|
|
84
|
+
window.open(data, '_blank');
|
|
85
|
+
return;
|
|
83
86
|
}
|
|
84
|
-
console.warn(
|
|
87
|
+
console.warn(`Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`);
|
|
85
88
|
}
|
|
86
89
|
function getHandlers(props) {
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
let chain;
|
|
91
|
+
let wallet;
|
|
89
92
|
if ('signer' in props &&
|
|
90
93
|
typeof props.signer === 'object' &&
|
|
91
94
|
props.signer &&
|
|
@@ -100,13 +103,13 @@ function getHandlers(props) {
|
|
|
100
103
|
}
|
|
101
104
|
if (!chain) {
|
|
102
105
|
return {
|
|
103
|
-
handleSendTransaction:
|
|
106
|
+
handleSendTransaction: () => {
|
|
104
107
|
throw new Error('handleSendTransaction Not Implemented');
|
|
105
108
|
},
|
|
106
|
-
handleSignMessage:
|
|
109
|
+
handleSignMessage: () => {
|
|
107
110
|
throw new Error('handleSendTransaction Not Implemented');
|
|
108
111
|
},
|
|
109
|
-
handleSignTransaction:
|
|
112
|
+
handleSignTransaction: () => {
|
|
110
113
|
throw new Error('handleSendTransaction Not Implemented');
|
|
111
114
|
},
|
|
112
115
|
onSuccess: props.onSuccess,
|
|
@@ -114,115 +117,81 @@ function getHandlers(props) {
|
|
|
114
117
|
};
|
|
115
118
|
}
|
|
116
119
|
return CoinflowUtils_1.CoinflowUtils.byBlockchain(chain, {
|
|
117
|
-
solana:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
monad: function () {
|
|
160
|
-
return getEvmWalletHandlers({
|
|
161
|
-
wallet: wallet,
|
|
162
|
-
onSuccess: props.onSuccess,
|
|
163
|
-
onAuthDeclined: props.onAuthDeclined,
|
|
164
|
-
});
|
|
165
|
-
},
|
|
166
|
-
user: function () { return getSessionKeyHandlers(props); },
|
|
120
|
+
solana: () => getSolanaWalletHandlers({
|
|
121
|
+
wallet: wallet,
|
|
122
|
+
onSuccess: props.onSuccess,
|
|
123
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
124
|
+
}),
|
|
125
|
+
eth: () => getEvmWalletHandlers({
|
|
126
|
+
wallet: wallet,
|
|
127
|
+
onSuccess: props.onSuccess,
|
|
128
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
129
|
+
}),
|
|
130
|
+
polygon: () => getEvmWalletHandlers({
|
|
131
|
+
wallet: wallet,
|
|
132
|
+
onSuccess: props.onSuccess,
|
|
133
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
134
|
+
}),
|
|
135
|
+
base: () => getEvmWalletHandlers({
|
|
136
|
+
wallet: wallet,
|
|
137
|
+
onSuccess: props.onSuccess,
|
|
138
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
139
|
+
}),
|
|
140
|
+
arbitrum: () => getEvmWalletHandlers({
|
|
141
|
+
wallet: wallet,
|
|
142
|
+
onSuccess: props.onSuccess,
|
|
143
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
144
|
+
}),
|
|
145
|
+
stellar: () => getStellarWalletHandlers({
|
|
146
|
+
wallet: wallet,
|
|
147
|
+
onSuccess: props.onSuccess,
|
|
148
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
149
|
+
}),
|
|
150
|
+
monad: () => getEvmWalletHandlers({
|
|
151
|
+
wallet: wallet,
|
|
152
|
+
onSuccess: props.onSuccess,
|
|
153
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
154
|
+
}),
|
|
155
|
+
tempo: () => getEvmWalletHandlers({
|
|
156
|
+
wallet: wallet,
|
|
157
|
+
onSuccess: props.onSuccess,
|
|
158
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
159
|
+
}),
|
|
160
|
+
user: () => getSessionKeyHandlers(props),
|
|
167
161
|
})();
|
|
168
162
|
}
|
|
169
|
-
function getSolanaWalletHandlers(
|
|
170
|
-
var _this = this;
|
|
171
|
-
var wallet = _a.wallet, onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
163
|
+
function getSolanaWalletHandlers({ wallet, onSuccess, onAuthDeclined, }) {
|
|
172
164
|
return {
|
|
173
|
-
handleSendTransaction:
|
|
174
|
-
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var signTransaction, tx, signedTransaction;
|
|
204
|
-
return tslib_1.__generator(this, function (_a) {
|
|
205
|
-
switch (_a.label) {
|
|
206
|
-
case 0:
|
|
207
|
-
signTransaction = wallet.signTransaction;
|
|
208
|
-
if (!signTransaction) {
|
|
209
|
-
throw new Error('signTransaction is not supported by this wallet');
|
|
210
|
-
}
|
|
211
|
-
tx = getSolanaTransaction(transaction);
|
|
212
|
-
return [4 /*yield*/, signTransaction(tx)];
|
|
213
|
-
case 1:
|
|
214
|
-
signedTransaction = _a.sent();
|
|
215
|
-
if (!SolanaPeerDeps_1.base58)
|
|
216
|
-
throw new Error('bs58 dependency is required');
|
|
217
|
-
return [2 /*return*/, SolanaPeerDeps_1.base58.encode(Uint8Array.from(signedTransaction.serialize({
|
|
218
|
-
requireAllSignatures: false,
|
|
219
|
-
verifySignatures: false,
|
|
220
|
-
})))];
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}); },
|
|
224
|
-
onSuccess: onSuccess,
|
|
225
|
-
onAuthDeclined: onAuthDeclined,
|
|
165
|
+
handleSendTransaction: async (transaction) => {
|
|
166
|
+
const tx = getSolanaTransaction(transaction);
|
|
167
|
+
return await wallet.sendTransaction(tx);
|
|
168
|
+
},
|
|
169
|
+
handleSignMessage: async (message) => {
|
|
170
|
+
const signMessage = wallet.signMessage;
|
|
171
|
+
if (!signMessage) {
|
|
172
|
+
throw new Error('signMessage is not supported by this wallet');
|
|
173
|
+
}
|
|
174
|
+
const signedMessage = await signMessage(new TextEncoder().encode(message));
|
|
175
|
+
if (!SolanaPeerDeps_1.base58)
|
|
176
|
+
throw new Error('bs58 dependency is required');
|
|
177
|
+
return SolanaPeerDeps_1.base58.encode(signedMessage);
|
|
178
|
+
},
|
|
179
|
+
handleSignTransaction: async (transaction) => {
|
|
180
|
+
const signTransaction = wallet.signTransaction;
|
|
181
|
+
if (!signTransaction) {
|
|
182
|
+
throw new Error('signTransaction is not supported by this wallet');
|
|
183
|
+
}
|
|
184
|
+
const tx = getSolanaTransaction(transaction);
|
|
185
|
+
const signedTransaction = await signTransaction(tx);
|
|
186
|
+
if (!SolanaPeerDeps_1.base58)
|
|
187
|
+
throw new Error('bs58 dependency is required');
|
|
188
|
+
return SolanaPeerDeps_1.base58.encode(Uint8Array.from(signedTransaction.serialize({
|
|
189
|
+
requireAllSignatures: false,
|
|
190
|
+
verifySignatures: false,
|
|
191
|
+
})));
|
|
192
|
+
},
|
|
193
|
+
onSuccess,
|
|
194
|
+
onAuthDeclined,
|
|
226
195
|
};
|
|
227
196
|
}
|
|
228
197
|
function getSolanaTransaction(data) {
|
|
@@ -230,92 +199,58 @@ function getSolanaTransaction(data) {
|
|
|
230
199
|
throw new Error('@solana/web3.js is not defined. Please install @solana/web3.js into your project');
|
|
231
200
|
if (!SolanaPeerDeps_1.base58)
|
|
232
201
|
throw new Error('bs58 is not defined. Please install bs58 into your project');
|
|
233
|
-
|
|
234
|
-
|
|
202
|
+
const parsedUInt8Array = SolanaPeerDeps_1.base58.decode(data);
|
|
203
|
+
const vtx = SolanaPeerDeps_1.web3.VersionedTransaction.deserialize(parsedUInt8Array);
|
|
235
204
|
if (vtx.version === 'legacy')
|
|
236
205
|
return SolanaPeerDeps_1.web3.Transaction.from(parsedUInt8Array);
|
|
237
206
|
return vtx;
|
|
238
207
|
}
|
|
239
|
-
function getEvmWalletHandlers(
|
|
240
|
-
var _this = this;
|
|
241
|
-
var wallet = _a.wallet, onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
208
|
+
function getEvmWalletHandlers({ wallet, onSuccess, onAuthDeclined, }) {
|
|
242
209
|
return {
|
|
243
|
-
handleSendTransaction:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}); },
|
|
256
|
-
handleSignMessage: function (message) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
257
|
-
return tslib_1.__generator(this, function (_a) {
|
|
258
|
-
return [2 /*return*/, wallet.signMessage(message)];
|
|
259
|
-
});
|
|
260
|
-
}); },
|
|
261
|
-
onSuccess: onSuccess,
|
|
262
|
-
onAuthDeclined: onAuthDeclined,
|
|
210
|
+
handleSendTransaction: async (transaction) => {
|
|
211
|
+
const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
212
|
+
const { hash } = await wallet.sendTransaction(tx);
|
|
213
|
+
return hash;
|
|
214
|
+
},
|
|
215
|
+
handleSignMessage: async (message) => {
|
|
216
|
+
return wallet.signMessage(message);
|
|
217
|
+
},
|
|
218
|
+
onSuccess,
|
|
219
|
+
onAuthDeclined,
|
|
263
220
|
};
|
|
264
221
|
}
|
|
265
|
-
function getStellarWalletHandlers(
|
|
266
|
-
var _this = this;
|
|
267
|
-
var wallet = _a.wallet, onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
222
|
+
function getStellarWalletHandlers({ wallet, onSuccess, onAuthDeclined, }) {
|
|
268
223
|
return {
|
|
269
|
-
handleSendTransaction:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
handleSignTransaction: function (transaction) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
291
|
-
return tslib_1.__generator(this, function (_a) {
|
|
292
|
-
switch (_a.label) {
|
|
293
|
-
case 0:
|
|
294
|
-
if (!wallet.signTransaction) {
|
|
295
|
-
throw new Error('signTransaction is not supported by this wallet');
|
|
296
|
-
}
|
|
297
|
-
return [4 /*yield*/, wallet.signTransaction(transaction)];
|
|
298
|
-
case 1:
|
|
299
|
-
// Returns signed base64 XDR
|
|
300
|
-
return [2 /*return*/, _a.sent()];
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
}); },
|
|
304
|
-
onSuccess: onSuccess,
|
|
305
|
-
onAuthDeclined: onAuthDeclined,
|
|
224
|
+
handleSendTransaction: async (transaction) => {
|
|
225
|
+
// transaction is unsigned base64 XDR
|
|
226
|
+
// dapp needs to handle sending and confirming
|
|
227
|
+
throw new Error(`sendTransaction is not supported on stellar, error when sending: ${transaction}`);
|
|
228
|
+
},
|
|
229
|
+
handleSignMessage: async (message) => {
|
|
230
|
+
if (!wallet.signMessage) {
|
|
231
|
+
throw new Error('signMessage is not supported by this wallet');
|
|
232
|
+
}
|
|
233
|
+
// Returns base64-encoded signature
|
|
234
|
+
return await wallet.signMessage(message);
|
|
235
|
+
},
|
|
236
|
+
handleSignTransaction: async (transaction) => {
|
|
237
|
+
if (!wallet.signTransaction) {
|
|
238
|
+
throw new Error('signTransaction is not supported by this wallet');
|
|
239
|
+
}
|
|
240
|
+
// Returns signed base64 XDR
|
|
241
|
+
return await wallet.signTransaction(transaction);
|
|
242
|
+
},
|
|
243
|
+
onSuccess,
|
|
244
|
+
onAuthDeclined,
|
|
306
245
|
};
|
|
307
246
|
}
|
|
308
|
-
function getSessionKeyHandlers(
|
|
309
|
-
var _this = this;
|
|
310
|
-
var onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
247
|
+
function getSessionKeyHandlers({ onSuccess, onAuthDeclined, }) {
|
|
311
248
|
return {
|
|
312
|
-
handleSendTransaction:
|
|
313
|
-
return
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
onSuccess: onSuccess,
|
|
318
|
-
onAuthDeclined: onAuthDeclined,
|
|
249
|
+
handleSendTransaction: async () => {
|
|
250
|
+
return Promise.resolve('');
|
|
251
|
+
},
|
|
252
|
+
onSuccess,
|
|
253
|
+
onAuthDeclined,
|
|
319
254
|
};
|
|
320
255
|
}
|
|
321
256
|
//# sourceMappingURL=CoinflowLibMessageHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";;;;;;AAWA,mDAA8C;AAE9C,qDAA8C;AA2B9C,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC9B,mDAA2B,CAAA;IAC3B,2DAAmC,CAAA;IACnC,2DAAmC,CAAA;IACnC,qDAA6B,CAAA;IAC7B,2CAAmB,CAAA;IACnB,qDAA6B,CAAA;IAC7B,yCAAiB,CAAA;IACjB,uDAA+B,CAAA;IAC/B,6CAAqB,CAAA;AACvB,CAAC,EAVW,oBAAoB,aAApB,oBAAoB,GAApB,oBAAoB,QAU/B;AAED,yBACE,KAA2D;IAE3D,IAAI,MAA+B,CAAC;IACpC,IACE,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,CAAC,MAAM;QACZ,QAAQ,IAAI,KAAK,CAAC,MAAM;QAExB,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAqB,CAAC;SACzC,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM;QAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAElE,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,IAAI,OAAO,MAAM,K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eAAe,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACrE,CAAC;YACD,4BAA4B;YAC5B,OAAO,MAAM,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC;QACD,SAAS;QACT,cAAc;KACf,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,cAAc,GAC8C;IAI5D,OAAO;QACL,qBAAqB,EAAE,KAAK,IAAI,EAAE;YAChC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,SAAS;QACT,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -122,7 +122,7 @@ export interface SplitNameCustomerInfo extends BaseCustomerInfo {
|
|
|
122
122
|
}
|
|
123
123
|
export type CustomerInfo = SplitNameCustomerInfo | NameCustomerInfo;
|
|
124
124
|
/** Coinflow Types **/
|
|
125
|
-
export type CoinflowBlockchain = 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'stellar' | 'monad' | 'user';
|
|
125
|
+
export type CoinflowBlockchain = 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'stellar' | 'monad' | 'tempo' | 'user';
|
|
126
126
|
export type CoinflowEnvs = 'prod' | 'staging' | 'staging-live' | 'sandbox' | 'local';
|
|
127
127
|
export interface CoinflowTypes {
|
|
128
128
|
merchantId: string;
|
|
@@ -198,7 +198,7 @@ export interface CoinflowSessionKeyHistoryProps extends CoinflowTypes {
|
|
|
198
198
|
}
|
|
199
199
|
export interface CoinflowEvmHistoryProps extends CoinflowTypes {
|
|
200
200
|
wallet: EthWallet;
|
|
201
|
-
blockchain: 'eth' | 'polygon' | 'base' | 'arbitrum' | 'monad';
|
|
201
|
+
blockchain: 'eth' | 'polygon' | 'base' | 'arbitrum' | 'monad' | 'tempo';
|
|
202
202
|
}
|
|
203
203
|
export interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {
|
|
204
204
|
blockchain: 'eth';
|
|
@@ -219,7 +219,10 @@ export interface CoinflowStellarHistoryProps extends CoinflowTypes {
|
|
|
219
219
|
export interface CoinflowMonadHistoryProps extends CoinflowEvmHistoryProps {
|
|
220
220
|
blockchain: 'monad';
|
|
221
221
|
}
|
|
222
|
-
export
|
|
222
|
+
export interface CoinflowTempoHistoryProps extends CoinflowEvmHistoryProps {
|
|
223
|
+
blockchain: 'tempo';
|
|
224
|
+
}
|
|
225
|
+
export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps | CoinflowStellarHistoryProps | CoinflowMonadHistoryProps | CoinflowTempoHistoryProps | CoinflowSessionKeyHistoryProps;
|
|
223
226
|
type Bytes = ArrayLike<number>;
|
|
224
227
|
type BytesLike = Bytes | string;
|
|
225
228
|
/**
|
|
@@ -253,8 +256,8 @@ export declare enum PaymentMethods {
|
|
|
253
256
|
applePay = "applePay",
|
|
254
257
|
credits = "credits",
|
|
255
258
|
crypto = "crypto",
|
|
256
|
-
|
|
257
|
-
|
|
259
|
+
wire = "wire",
|
|
260
|
+
cashApp = "cashApp"
|
|
258
261
|
}
|
|
259
262
|
export declare const paymentMethodLabels: Record<PaymentMethods, string>;
|
|
260
263
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
@@ -266,6 +269,7 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
266
269
|
customPayInFees?: PurchaseCustomPayInFee[];
|
|
267
270
|
presentment?: Currency;
|
|
268
271
|
onSuccess?: OnSuccessMethod;
|
|
272
|
+
sessionKey?: string;
|
|
269
273
|
onAuthDeclined?: OnAuthDeclinedMethod;
|
|
270
274
|
webhookInfo?: {
|
|
271
275
|
[key: string]: any;
|
|
@@ -375,7 +379,10 @@ export interface CoinflowStellarPurchaseProps extends CoinflowCommonPurchaseProp
|
|
|
375
379
|
export interface CoinflowMonadPurchaseProps extends CoinflowEvmPurchaseProps {
|
|
376
380
|
blockchain: 'monad';
|
|
377
381
|
}
|
|
378
|
-
export
|
|
382
|
+
export interface CoinflowTempoPurchaseProps extends CoinflowEvmPurchaseProps {
|
|
383
|
+
blockchain: 'tempo';
|
|
384
|
+
}
|
|
385
|
+
export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowSessionKeyPurchaseProps | CoinflowPolygonPurchaseProps | CoinflowEthPurchaseProps | CoinflowBasePurchaseProps | CoinflowArbitrumPurchaseProps | CoinflowStellarPurchaseProps | CoinflowMonadPurchaseProps | CoinflowTempoPurchaseProps;
|
|
379
386
|
/** Withdraw **/
|
|
380
387
|
export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
381
388
|
onSuccess?: OnSuccessMethod;
|
|
@@ -386,7 +393,7 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
386
393
|
bankAccountLinkRedirect?: string;
|
|
387
394
|
additionalWallets?: {
|
|
388
395
|
wallet: string;
|
|
389
|
-
blockchain: 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'monad' | 'stellar';
|
|
396
|
+
blockchain: 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'monad' | 'tempo' | 'stellar';
|
|
390
397
|
}[];
|
|
391
398
|
lockAmount?: boolean;
|
|
392
399
|
transactionSigner?: string;
|
|
@@ -445,7 +452,11 @@ export interface MonadWalletProps {
|
|
|
445
452
|
blockchain: 'monad';
|
|
446
453
|
}
|
|
447
454
|
export type CoinflowMonadWithdrawProps = CoinflowEvmWithdrawProps & MonadWalletProps;
|
|
448
|
-
export
|
|
455
|
+
export interface TempoWalletProps {
|
|
456
|
+
blockchain: 'tempo';
|
|
457
|
+
}
|
|
458
|
+
export type CoinflowTempoWithdrawProps = CoinflowEvmWithdrawProps & TempoWalletProps;
|
|
459
|
+
export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps | CoinflowBaseWithdrawProps | CoinflowArbitrumWithdrawProps | CoinflowStellarWithdrawProps | CoinflowMonadWithdrawProps | CoinflowTempoWithdrawProps;
|
|
449
460
|
export interface CommonEvmRedeem {
|
|
450
461
|
/**
|
|
451
462
|
* Whether the UI should wait
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.RN_REDIRECT_MESSAGE_NAME = exports.CardType = exports.paymentMethodLabels = exports.PaymentMethods = exports.ThreeDsChallengePreference = exports.ChargebackProtectionAccountType = exports.MerchantStyle = exports.SettlementType = exports.WithdrawSpeed = exports.WithdrawCategory = void 0;
|
|
5
4
|
exports.isZeroAuthVerifyCard = isZeroAuthVerifyCard;
|
|
@@ -65,23 +64,23 @@ var PaymentMethods;
|
|
|
65
64
|
PaymentMethods["applePay"] = "applePay";
|
|
66
65
|
PaymentMethods["credits"] = "credits";
|
|
67
66
|
PaymentMethods["crypto"] = "crypto";
|
|
68
|
-
PaymentMethods["instantBankTransfer"] = "instantBankTransfer";
|
|
69
67
|
PaymentMethods["wire"] = "wire";
|
|
68
|
+
PaymentMethods["cashApp"] = "cashApp";
|
|
70
69
|
})(PaymentMethods || (exports.PaymentMethods = PaymentMethods = {}));
|
|
71
|
-
exports.paymentMethodLabels =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
exports.paymentMethodLabels = {
|
|
71
|
+
[PaymentMethods.card]: 'Card',
|
|
72
|
+
[PaymentMethods.ach]: 'ACH',
|
|
73
|
+
[PaymentMethods.fasterPayments]: 'Faster Payments',
|
|
74
|
+
[PaymentMethods.sepa]: 'SEPA',
|
|
75
|
+
[PaymentMethods.pix]: 'PIX',
|
|
76
|
+
[PaymentMethods.usdc]: 'USDC',
|
|
77
|
+
[PaymentMethods.googlePay]: 'Google Pay',
|
|
78
|
+
[PaymentMethods.applePay]: 'Apple Pay',
|
|
79
|
+
[PaymentMethods.credits]: 'Credits',
|
|
80
|
+
[PaymentMethods.crypto]: 'Crypto',
|
|
81
|
+
[PaymentMethods.wire]: 'Wire Transfer',
|
|
82
|
+
[PaymentMethods.cashApp]: 'CashApp',
|
|
83
|
+
};
|
|
85
84
|
var CardType;
|
|
86
85
|
(function (CardType) {
|
|
87
86
|
CardType["VISA"] = "VISA";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":";;;;;AAaA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QAG3B;AAED,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,oCAAmB,CAAA;AACrB,CAAC,EAZW,aAAa,aAAb,aAAa,GAAb,aAAa,QAYxB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,aAAd,cAAc,GAAd,cAAc,QAIzB;AAoDD,8BACE,MAA+B;IAE/B,OAAO,WAAW,IAAI,MAAM,CAAC;AA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AAS,CAAC,EAAE,YAAY;IACxC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,WAAW;IACtC,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS;IACnC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ;IACjC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,eAAe;IACtC,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS;CACpC,CAAC;AA8bF,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,aAAR,QAAQ,GAAR,QAAQ,QAKnB;AA4CY,QAAA,wBAAwB,GAAG,YAAY,CAAC,CAAC,gBAAgB"}
|
|
@@ -7,7 +7,7 @@ export declare class CoinflowUtils {
|
|
|
7
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
8
8
|
static getCoinflowAppBaseUrl(env?: CoinflowEnvs): string;
|
|
9
9
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
10
|
-
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, customPayInFees, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, baseUrl
|
|
10
|
+
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, customPayInFees, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, baseUrl }: CoinflowIFrameProps & {
|
|
11
11
|
baseUrl?: string;
|
|
12
12
|
}): string;
|
|
13
13
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
@@ -19,6 +19,7 @@ export declare class CoinflowUtils {
|
|
|
19
19
|
arbitrum: T;
|
|
20
20
|
stellar: T;
|
|
21
21
|
monad: T;
|
|
22
|
+
tempo: T;
|
|
22
23
|
user: T;
|
|
23
24
|
}): T;
|
|
24
25
|
}
|