@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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
2
1
|
import { CoinflowUtils } from './CoinflowUtils';
|
|
3
2
|
import { web3, base58 } from './SolanaPeerDeps';
|
|
4
3
|
export var IFrameMessageMethods;
|
|
@@ -11,9 +10,10 @@ export var IFrameMessageMethods;
|
|
|
11
10
|
IFrameMessageMethods["AuthDeclined"] = "authDeclined";
|
|
12
11
|
IFrameMessageMethods["Loaded"] = "loaded";
|
|
13
12
|
IFrameMessageMethods["AccountLinked"] = "accountLinked";
|
|
13
|
+
IFrameMessageMethods["Redirect"] = "redirect";
|
|
14
14
|
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
15
15
|
export function getWalletPubkey(input) {
|
|
16
|
-
|
|
16
|
+
let wallet;
|
|
17
17
|
if ('signer' in input &&
|
|
18
18
|
typeof input.signer === 'object' &&
|
|
19
19
|
input.signer &&
|
|
@@ -34,7 +34,7 @@ export function getWalletPubkey(input) {
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
export function handleIFrameMessage(rawMessage, handlers, handleHeightChangeId) {
|
|
37
|
-
|
|
37
|
+
let walletCall;
|
|
38
38
|
try {
|
|
39
39
|
walletCall = JSON.parse(rawMessage);
|
|
40
40
|
if (!('method' in walletCall) || !('data' in walletCall))
|
|
@@ -44,7 +44,7 @@ export function handleIFrameMessage(rawMessage, handlers, handleHeightChangeId)
|
|
|
44
44
|
console.error('handleIFrameMessage JSON parse', e);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
const { data, method } = walletCall;
|
|
48
48
|
switch (method) {
|
|
49
49
|
case IFrameMessageMethods.SignMessage:
|
|
50
50
|
if (!handlers.handleSignMessage)
|
|
@@ -74,12 +74,15 @@ export function handleIFrameMessage(rawMessage, handlers, handleHeightChangeId)
|
|
|
74
74
|
return;
|
|
75
75
|
case IFrameMessageMethods.AccountLinked:
|
|
76
76
|
return;
|
|
77
|
+
case IFrameMessageMethods.Redirect:
|
|
78
|
+
window.open(data, '_blank');
|
|
79
|
+
return;
|
|
77
80
|
}
|
|
78
|
-
console.warn(
|
|
81
|
+
console.warn(`Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`);
|
|
79
82
|
}
|
|
80
83
|
export function getHandlers(props) {
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
let chain;
|
|
85
|
+
let wallet;
|
|
83
86
|
if ('signer' in props &&
|
|
84
87
|
typeof props.signer === 'object' &&
|
|
85
88
|
props.signer &&
|
|
@@ -94,13 +97,13 @@ export function getHandlers(props) {
|
|
|
94
97
|
}
|
|
95
98
|
if (!chain) {
|
|
96
99
|
return {
|
|
97
|
-
handleSendTransaction:
|
|
100
|
+
handleSendTransaction: () => {
|
|
98
101
|
throw new Error('handleSendTransaction Not Implemented');
|
|
99
102
|
},
|
|
100
|
-
handleSignMessage:
|
|
103
|
+
handleSignMessage: () => {
|
|
101
104
|
throw new Error('handleSendTransaction Not Implemented');
|
|
102
105
|
},
|
|
103
|
-
handleSignTransaction:
|
|
106
|
+
handleSignTransaction: () => {
|
|
104
107
|
throw new Error('handleSendTransaction Not Implemented');
|
|
105
108
|
},
|
|
106
109
|
onSuccess: props.onSuccess,
|
|
@@ -108,115 +111,81 @@ export function getHandlers(props) {
|
|
|
108
111
|
};
|
|
109
112
|
}
|
|
110
113
|
return CoinflowUtils.byBlockchain(chain, {
|
|
111
|
-
solana:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
monad: function () {
|
|
154
|
-
return getEvmWalletHandlers({
|
|
155
|
-
wallet: wallet,
|
|
156
|
-
onSuccess: props.onSuccess,
|
|
157
|
-
onAuthDeclined: props.onAuthDeclined,
|
|
158
|
-
});
|
|
159
|
-
},
|
|
160
|
-
user: function () { return getSessionKeyHandlers(props); },
|
|
114
|
+
solana: () => getSolanaWalletHandlers({
|
|
115
|
+
wallet: wallet,
|
|
116
|
+
onSuccess: props.onSuccess,
|
|
117
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
118
|
+
}),
|
|
119
|
+
eth: () => getEvmWalletHandlers({
|
|
120
|
+
wallet: wallet,
|
|
121
|
+
onSuccess: props.onSuccess,
|
|
122
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
123
|
+
}),
|
|
124
|
+
polygon: () => getEvmWalletHandlers({
|
|
125
|
+
wallet: wallet,
|
|
126
|
+
onSuccess: props.onSuccess,
|
|
127
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
128
|
+
}),
|
|
129
|
+
base: () => getEvmWalletHandlers({
|
|
130
|
+
wallet: wallet,
|
|
131
|
+
onSuccess: props.onSuccess,
|
|
132
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
133
|
+
}),
|
|
134
|
+
arbitrum: () => getEvmWalletHandlers({
|
|
135
|
+
wallet: wallet,
|
|
136
|
+
onSuccess: props.onSuccess,
|
|
137
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
138
|
+
}),
|
|
139
|
+
stellar: () => getStellarWalletHandlers({
|
|
140
|
+
wallet: wallet,
|
|
141
|
+
onSuccess: props.onSuccess,
|
|
142
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
143
|
+
}),
|
|
144
|
+
monad: () => getEvmWalletHandlers({
|
|
145
|
+
wallet: wallet,
|
|
146
|
+
onSuccess: props.onSuccess,
|
|
147
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
148
|
+
}),
|
|
149
|
+
tempo: () => getEvmWalletHandlers({
|
|
150
|
+
wallet: wallet,
|
|
151
|
+
onSuccess: props.onSuccess,
|
|
152
|
+
onAuthDeclined: props.onAuthDeclined,
|
|
153
|
+
}),
|
|
154
|
+
user: () => getSessionKeyHandlers(props),
|
|
161
155
|
})();
|
|
162
156
|
}
|
|
163
|
-
function getSolanaWalletHandlers(
|
|
164
|
-
var _this = this;
|
|
165
|
-
var wallet = _a.wallet, onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
157
|
+
function getSolanaWalletHandlers({ wallet, onSuccess, onAuthDeclined, }) {
|
|
166
158
|
return {
|
|
167
|
-
handleSendTransaction:
|
|
168
|
-
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
var signTransaction, tx, signedTransaction;
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
switch (_a.label) {
|
|
200
|
-
case 0:
|
|
201
|
-
signTransaction = wallet.signTransaction;
|
|
202
|
-
if (!signTransaction) {
|
|
203
|
-
throw new Error('signTransaction is not supported by this wallet');
|
|
204
|
-
}
|
|
205
|
-
tx = getSolanaTransaction(transaction);
|
|
206
|
-
return [4 /*yield*/, signTransaction(tx)];
|
|
207
|
-
case 1:
|
|
208
|
-
signedTransaction = _a.sent();
|
|
209
|
-
if (!base58)
|
|
210
|
-
throw new Error('bs58 dependency is required');
|
|
211
|
-
return [2 /*return*/, base58.encode(Uint8Array.from(signedTransaction.serialize({
|
|
212
|
-
requireAllSignatures: false,
|
|
213
|
-
verifySignatures: false,
|
|
214
|
-
})))];
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}); },
|
|
218
|
-
onSuccess: onSuccess,
|
|
219
|
-
onAuthDeclined: onAuthDeclined,
|
|
159
|
+
handleSendTransaction: async (transaction) => {
|
|
160
|
+
const tx = getSolanaTransaction(transaction);
|
|
161
|
+
return await wallet.sendTransaction(tx);
|
|
162
|
+
},
|
|
163
|
+
handleSignMessage: async (message) => {
|
|
164
|
+
const signMessage = wallet.signMessage;
|
|
165
|
+
if (!signMessage) {
|
|
166
|
+
throw new Error('signMessage is not supported by this wallet');
|
|
167
|
+
}
|
|
168
|
+
const signedMessage = await signMessage(new TextEncoder().encode(message));
|
|
169
|
+
if (!base58)
|
|
170
|
+
throw new Error('bs58 dependency is required');
|
|
171
|
+
return base58.encode(signedMessage);
|
|
172
|
+
},
|
|
173
|
+
handleSignTransaction: async (transaction) => {
|
|
174
|
+
const signTransaction = wallet.signTransaction;
|
|
175
|
+
if (!signTransaction) {
|
|
176
|
+
throw new Error('signTransaction is not supported by this wallet');
|
|
177
|
+
}
|
|
178
|
+
const tx = getSolanaTransaction(transaction);
|
|
179
|
+
const signedTransaction = await signTransaction(tx);
|
|
180
|
+
if (!base58)
|
|
181
|
+
throw new Error('bs58 dependency is required');
|
|
182
|
+
return base58.encode(Uint8Array.from(signedTransaction.serialize({
|
|
183
|
+
requireAllSignatures: false,
|
|
184
|
+
verifySignatures: false,
|
|
185
|
+
})));
|
|
186
|
+
},
|
|
187
|
+
onSuccess,
|
|
188
|
+
onAuthDeclined,
|
|
220
189
|
};
|
|
221
190
|
}
|
|
222
191
|
function getSolanaTransaction(data) {
|
|
@@ -224,92 +193,58 @@ function getSolanaTransaction(data) {
|
|
|
224
193
|
throw new Error('@solana/web3.js is not defined. Please install @solana/web3.js into your project');
|
|
225
194
|
if (!base58)
|
|
226
195
|
throw new Error('bs58 is not defined. Please install bs58 into your project');
|
|
227
|
-
|
|
228
|
-
|
|
196
|
+
const parsedUInt8Array = base58.decode(data);
|
|
197
|
+
const vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);
|
|
229
198
|
if (vtx.version === 'legacy')
|
|
230
199
|
return web3.Transaction.from(parsedUInt8Array);
|
|
231
200
|
return vtx;
|
|
232
201
|
}
|
|
233
|
-
function getEvmWalletHandlers(
|
|
234
|
-
var _this = this;
|
|
235
|
-
var wallet = _a.wallet, onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
202
|
+
function getEvmWalletHandlers({ wallet, onSuccess, onAuthDeclined, }) {
|
|
236
203
|
return {
|
|
237
|
-
handleSendTransaction:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}); },
|
|
250
|
-
handleSignMessage: function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
251
|
-
return __generator(this, function (_a) {
|
|
252
|
-
return [2 /*return*/, wallet.signMessage(message)];
|
|
253
|
-
});
|
|
254
|
-
}); },
|
|
255
|
-
onSuccess: onSuccess,
|
|
256
|
-
onAuthDeclined: onAuthDeclined,
|
|
204
|
+
handleSendTransaction: async (transaction) => {
|
|
205
|
+
const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
206
|
+
const { hash } = await wallet.sendTransaction(tx);
|
|
207
|
+
return hash;
|
|
208
|
+
},
|
|
209
|
+
handleSignMessage: async (message) => {
|
|
210
|
+
return wallet.signMessage(message);
|
|
211
|
+
},
|
|
212
|
+
onSuccess,
|
|
213
|
+
onAuthDeclined,
|
|
257
214
|
};
|
|
258
215
|
}
|
|
259
|
-
function getStellarWalletHandlers(
|
|
260
|
-
var _this = this;
|
|
261
|
-
var wallet = _a.wallet, onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
216
|
+
function getStellarWalletHandlers({ wallet, onSuccess, onAuthDeclined, }) {
|
|
262
217
|
return {
|
|
263
|
-
handleSendTransaction:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
handleSignTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
285
|
-
return __generator(this, function (_a) {
|
|
286
|
-
switch (_a.label) {
|
|
287
|
-
case 0:
|
|
288
|
-
if (!wallet.signTransaction) {
|
|
289
|
-
throw new Error('signTransaction is not supported by this wallet');
|
|
290
|
-
}
|
|
291
|
-
return [4 /*yield*/, wallet.signTransaction(transaction)];
|
|
292
|
-
case 1:
|
|
293
|
-
// Returns signed base64 XDR
|
|
294
|
-
return [2 /*return*/, _a.sent()];
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
}); },
|
|
298
|
-
onSuccess: onSuccess,
|
|
299
|
-
onAuthDeclined: onAuthDeclined,
|
|
218
|
+
handleSendTransaction: async (transaction) => {
|
|
219
|
+
// transaction is unsigned base64 XDR
|
|
220
|
+
// dapp needs to handle sending and confirming
|
|
221
|
+
throw new Error(`sendTransaction is not supported on stellar, error when sending: ${transaction}`);
|
|
222
|
+
},
|
|
223
|
+
handleSignMessage: async (message) => {
|
|
224
|
+
if (!wallet.signMessage) {
|
|
225
|
+
throw new Error('signMessage is not supported by this wallet');
|
|
226
|
+
}
|
|
227
|
+
// Returns base64-encoded signature
|
|
228
|
+
return await wallet.signMessage(message);
|
|
229
|
+
},
|
|
230
|
+
handleSignTransaction: async (transaction) => {
|
|
231
|
+
if (!wallet.signTransaction) {
|
|
232
|
+
throw new Error('signTransaction is not supported by this wallet');
|
|
233
|
+
}
|
|
234
|
+
// Returns signed base64 XDR
|
|
235
|
+
return await wallet.signTransaction(transaction);
|
|
236
|
+
},
|
|
237
|
+
onSuccess,
|
|
238
|
+
onAuthDeclined,
|
|
300
239
|
};
|
|
301
240
|
}
|
|
302
|
-
function getSessionKeyHandlers(
|
|
303
|
-
var _this = this;
|
|
304
|
-
var onSuccess = _a.onSuccess, onAuthDeclined = _a.onAuthDeclined;
|
|
241
|
+
function getSessionKeyHandlers({ onSuccess, onAuthDeclined, }) {
|
|
305
242
|
return {
|
|
306
|
-
handleSendTransaction:
|
|
307
|
-
return
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
onSuccess: onSuccess,
|
|
312
|
-
onAuthDeclined: onAuthDeclined,
|
|
243
|
+
handleSendTransaction: async () => {
|
|
244
|
+
return Promise.resolve('');
|
|
245
|
+
},
|
|
246
|
+
onSuccess,
|
|
247
|
+
onAuthDeclined,
|
|
313
248
|
};
|
|
314
249
|
}
|
|
315
250
|
//# 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/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O,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,4 +1,3 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
export var WithdrawCategory;
|
|
3
2
|
(function (WithdrawCategory) {
|
|
4
3
|
WithdrawCategory["USER"] = "user";
|
|
@@ -60,23 +59,23 @@ export var PaymentMethods;
|
|
|
60
59
|
PaymentMethods["applePay"] = "applePay";
|
|
61
60
|
PaymentMethods["credits"] = "credits";
|
|
62
61
|
PaymentMethods["crypto"] = "crypto";
|
|
63
|
-
PaymentMethods["instantBankTransfer"] = "instantBankTransfer";
|
|
64
62
|
PaymentMethods["wire"] = "wire";
|
|
63
|
+
PaymentMethods["cashApp"] = "cashApp";
|
|
65
64
|
})(PaymentMethods || (PaymentMethods = {}));
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
export const paymentMethodLabels = {
|
|
66
|
+
[PaymentMethods.card]: 'Card',
|
|
67
|
+
[PaymentMethods.ach]: 'ACH',
|
|
68
|
+
[PaymentMethods.fasterPayments]: 'Faster Payments',
|
|
69
|
+
[PaymentMethods.sepa]: 'SEPA',
|
|
70
|
+
[PaymentMethods.pix]: 'PIX',
|
|
71
|
+
[PaymentMethods.usdc]: 'USDC',
|
|
72
|
+
[PaymentMethods.googlePay]: 'Google Pay',
|
|
73
|
+
[PaymentMethods.applePay]: 'Apple Pay',
|
|
74
|
+
[PaymentMethods.credits]: 'Credits',
|
|
75
|
+
[PaymentMethods.crypto]: 'Crypto',
|
|
76
|
+
[PaymentMethods.wire]: 'Wire Transfer',
|
|
77
|
+
[PaymentMethods.cashApp]: 'CashApp',
|
|
78
|
+
};
|
|
80
79
|
export var CardType;
|
|
81
80
|
(function (CardType) {
|
|
82
81
|
CardType["VISA"] = "VISA";
|
|
@@ -84,5 +83,5 @@ export var CardType;
|
|
|
84
83
|
CardType["AMEX"] = "AMEX";
|
|
85
84
|
CardType["DISCOVER"] = "DISC";
|
|
86
85
|
})(CardType || (CardType = {}));
|
|
87
|
-
export
|
|
86
|
+
export const RN_REDIRECT_MESSAGE_NAME = 'rnredirect'; // DO NOT CHANGE
|
|
88
87
|
//# sourceMappingURL=CoinflowTypes.js.map
|
|
@@ -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,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,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,KAAb,aAAa,QAYxB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAoDD,MAAM,UAAU,oBAAoB,CAClC,MAA+B;IAE/B,OAAO,WAAW,IAAI,MAAM,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,MAA+B;IAE/B,OAAO,4BAA4B,IAAI,MAAM,CAAC;AAChD,CAAC;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAqOD,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACzC,k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,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB;AA4CD,MAAM,CAAC,MAAM,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
|
}
|