@coinflowlabs/react-native 3.4.0 → 3.4.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 +5 -1
- package/build/common/CoinflowLibMessageHandlers.d.ts +4 -4
- package/build/common/CoinflowLibMessageHandlers.js +82 -30
- package/build/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/common/CoinflowTypes.d.ts +27 -10
- package/build/common/CoinflowTypes.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoinflowPurchaseProps,
|
|
1
|
+
import { CoinflowPurchaseProps, OnSuccessMethod } from './CoinflowTypes';
|
|
2
2
|
export type WalletCall = {
|
|
3
3
|
method: IFrameMessageMethods;
|
|
4
4
|
data: string;
|
|
@@ -24,9 +24,9 @@ declare enum IFrameMessageMethods {
|
|
|
24
24
|
SendTransaction = "sendTransaction",
|
|
25
25
|
HeightChange = "heightChange",
|
|
26
26
|
Success = "success",
|
|
27
|
-
|
|
27
|
+
Loaded = "loaded"
|
|
28
28
|
}
|
|
29
|
-
export declare function getWalletPubkey(input:
|
|
29
|
+
export declare function getWalletPubkey(input: CoinflowPurchaseProps): string | null | undefined;
|
|
30
30
|
export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers): Promise<string> | void;
|
|
31
|
-
export declare function getHandlers(props:
|
|
31
|
+
export declare function getHandlers(props: CoinflowPurchaseProps): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
32
32
|
export {};
|
|
@@ -8,20 +8,28 @@ var IFrameMessageMethods;
|
|
|
8
8
|
IFrameMessageMethods["SendTransaction"] = "sendTransaction";
|
|
9
9
|
IFrameMessageMethods["HeightChange"] = "heightChange";
|
|
10
10
|
IFrameMessageMethods["Success"] = "success";
|
|
11
|
-
IFrameMessageMethods["
|
|
11
|
+
IFrameMessageMethods["Loaded"] = "loaded";
|
|
12
12
|
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
13
13
|
export function getWalletPubkey(input) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
var wallet;
|
|
15
|
+
if ('signer' in input &&
|
|
16
|
+
typeof input.signer === 'object' &&
|
|
17
|
+
input.signer &&
|
|
18
|
+
'wallet' in input.signer)
|
|
19
|
+
wallet = input.signer.wallet;
|
|
20
|
+
else if ('wallet' in input && input.wallet)
|
|
21
|
+
wallet = input.wallet;
|
|
22
|
+
if (!wallet)
|
|
23
|
+
return;
|
|
24
|
+
if (typeof wallet === 'string')
|
|
25
|
+
return wallet;
|
|
26
|
+
if (typeof wallet === 'object') {
|
|
27
|
+
if ('publicKey' in wallet)
|
|
28
|
+
return wallet.publicKey ? wallet.publicKey.toString() : undefined;
|
|
29
|
+
if ('address' in wallet)
|
|
30
|
+
return wallet.address ? wallet.address : undefined;
|
|
31
|
+
if ('accountId' in wallet)
|
|
32
|
+
return wallet.accountId ? wallet.accountId : undefined;
|
|
25
33
|
}
|
|
26
34
|
return null;
|
|
27
35
|
}
|
|
@@ -57,32 +65,78 @@ export function handleIFrameMessage(rawMessage, handlers) {
|
|
|
57
65
|
return;
|
|
58
66
|
handlers.onSuccess(walletCall.info);
|
|
59
67
|
return;
|
|
68
|
+
case IFrameMessageMethods.Loaded:
|
|
69
|
+
return;
|
|
60
70
|
}
|
|
61
71
|
console.warn("Didn't expect to get here, handleIFrameMessage method:".concat(method, " is not one of ").concat(Object.values(IFrameMessageMethods)));
|
|
62
72
|
}
|
|
63
73
|
export function getHandlers(props) {
|
|
64
|
-
|
|
74
|
+
var chain;
|
|
75
|
+
var wallet;
|
|
76
|
+
if ('signer' in props &&
|
|
77
|
+
typeof props.signer === 'object' &&
|
|
78
|
+
props.signer &&
|
|
79
|
+
'blockchain' in props.signer &&
|
|
80
|
+
'wallet' in props.signer) {
|
|
81
|
+
chain = props.signer.blockchain;
|
|
82
|
+
wallet = props.signer.wallet;
|
|
83
|
+
}
|
|
84
|
+
else if ('blockchain' in props && props.blockchain) {
|
|
85
|
+
chain = props.blockchain;
|
|
86
|
+
wallet = props.wallet;
|
|
87
|
+
}
|
|
88
|
+
if (!chain) {
|
|
65
89
|
return {
|
|
66
90
|
handleSendTransaction: function () {
|
|
67
|
-
throw new Error('handleSendTransaction Not Implemented
|
|
91
|
+
throw new Error('handleSendTransaction Not Implemented');
|
|
68
92
|
},
|
|
69
93
|
handleSignMessage: function () {
|
|
70
|
-
throw new Error('handleSendTransaction Not Implemented
|
|
94
|
+
throw new Error('handleSendTransaction Not Implemented');
|
|
71
95
|
},
|
|
72
96
|
handleSignTransaction: function () {
|
|
73
|
-
throw new Error('handleSendTransaction Not Implemented
|
|
97
|
+
throw new Error('handleSendTransaction Not Implemented');
|
|
74
98
|
},
|
|
75
99
|
onSuccess: props.onSuccess,
|
|
76
100
|
};
|
|
77
101
|
}
|
|
78
|
-
return CoinflowUtils.byBlockchain(
|
|
79
|
-
solana: function () {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
return CoinflowUtils.byBlockchain(chain, {
|
|
103
|
+
solana: function () {
|
|
104
|
+
return getSolanaWalletHandlers({
|
|
105
|
+
wallet: wallet,
|
|
106
|
+
onSuccess: props.onSuccess,
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
near: function () {
|
|
110
|
+
return getNearWalletHandlers({
|
|
111
|
+
wallet: wallet,
|
|
112
|
+
onSuccess: props.onSuccess,
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
eth: function () {
|
|
116
|
+
return getEvmWalletHandlers({
|
|
117
|
+
wallet: wallet,
|
|
118
|
+
onSuccess: props.onSuccess,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
polygon: function () {
|
|
122
|
+
return getEvmWalletHandlers({
|
|
123
|
+
wallet: wallet,
|
|
124
|
+
onSuccess: props.onSuccess,
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
base: function () {
|
|
128
|
+
return getEvmWalletHandlers({
|
|
129
|
+
wallet: wallet,
|
|
130
|
+
onSuccess: props.onSuccess,
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
arbitrum: function () {
|
|
134
|
+
return getEvmWalletHandlers({
|
|
135
|
+
wallet: wallet,
|
|
136
|
+
onSuccess: props.onSuccess,
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
user: function () { return getSessionKeyHandlers(props); },
|
|
86
140
|
})();
|
|
87
141
|
}
|
|
88
142
|
function getSolanaWalletHandlers(_a) {
|
|
@@ -157,7 +211,6 @@ function getSolanaTransaction(data) {
|
|
|
157
211
|
function getNearWalletHandlers(_a) {
|
|
158
212
|
var _this = this;
|
|
159
213
|
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
160
|
-
var nearWallet = wallet;
|
|
161
214
|
return {
|
|
162
215
|
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
163
216
|
var action, executionOutcome, transactionResult;
|
|
@@ -165,7 +218,7 @@ function getNearWalletHandlers(_a) {
|
|
|
165
218
|
switch (_a.label) {
|
|
166
219
|
case 0:
|
|
167
220
|
action = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
168
|
-
return [4 /*yield*/,
|
|
221
|
+
return [4 /*yield*/, wallet.signAndSendTransaction(action)];
|
|
169
222
|
case 1:
|
|
170
223
|
executionOutcome = _a.sent();
|
|
171
224
|
if (!executionOutcome)
|
|
@@ -181,7 +234,6 @@ function getNearWalletHandlers(_a) {
|
|
|
181
234
|
function getEvmWalletHandlers(_a) {
|
|
182
235
|
var _this = this;
|
|
183
236
|
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
184
|
-
var evmWallet = wallet;
|
|
185
237
|
return {
|
|
186
238
|
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
187
239
|
var tx, hash;
|
|
@@ -189,7 +241,7 @@ function getEvmWalletHandlers(_a) {
|
|
|
189
241
|
switch (_a.label) {
|
|
190
242
|
case 0:
|
|
191
243
|
tx = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
192
|
-
return [4 /*yield*/,
|
|
244
|
+
return [4 /*yield*/, wallet.sendTransaction(tx)];
|
|
193
245
|
case 1:
|
|
194
246
|
hash = (_a.sent()).hash;
|
|
195
247
|
return [2 /*return*/, hash];
|
|
@@ -198,13 +250,13 @@ function getEvmWalletHandlers(_a) {
|
|
|
198
250
|
}); },
|
|
199
251
|
handleSignMessage: function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
200
252
|
return __generator(this, function (_a) {
|
|
201
|
-
return [2 /*return*/,
|
|
253
|
+
return [2 /*return*/, wallet.signMessage(message)];
|
|
202
254
|
});
|
|
203
255
|
}); },
|
|
204
256
|
onSuccess: onSuccess,
|
|
205
257
|
};
|
|
206
258
|
}
|
|
207
|
-
function
|
|
259
|
+
function getSessionKeyHandlers(_a) {
|
|
208
260
|
var _this = this;
|
|
209
261
|
var onSuccess = _a.onSuccess;
|
|
210
262
|
return {
|
|
@@ -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":";AASA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAoB9C,IAAK,oBAOJ;AAPD,WAAK,oBAAoB;IACvB,mDAA2B,CAAA;IAC3B,2DAAmC,CAAA;IACnC,2DAAmC,CAAA;IACnC,qDAA6B,CAAA;I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{
|
|
|
97
97
|
connection: Connection;
|
|
98
98
|
blockchain: 'solana';
|
|
99
99
|
}
|
|
100
|
+
export interface CoinflowSessionKeyHistoryProps extends CoinflowTypes {
|
|
101
|
+
sessionKey: string;
|
|
102
|
+
blockchain?: undefined;
|
|
103
|
+
}
|
|
100
104
|
export interface CoinflowNearHistoryProps extends CoinflowTypes {
|
|
101
105
|
wallet: NearWallet;
|
|
102
106
|
blockchain: 'near';
|
|
103
107
|
}
|
|
104
108
|
export interface CoinflowEvmHistoryProps extends CoinflowTypes {
|
|
105
109
|
wallet: EthWallet;
|
|
110
|
+
blockchain: 'eth' | 'polygon' | 'base' | 'arbitrum';
|
|
106
111
|
}
|
|
107
112
|
export interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {
|
|
108
113
|
blockchain: 'eth';
|
|
@@ -116,7 +121,7 @@ export interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {
|
|
|
116
121
|
export interface CoinflowArbitrumHistoryProps extends CoinflowEvmHistoryProps {
|
|
117
122
|
blockchain: 'arbitrum';
|
|
118
123
|
}
|
|
119
|
-
export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps;
|
|
124
|
+
export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps | CoinflowSessionKeyHistoryProps;
|
|
120
125
|
/** Transactions **/
|
|
121
126
|
export type NearFtTransferCallAction = {
|
|
122
127
|
methodName: 'ft_transfer_call';
|
|
@@ -252,33 +257,45 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
252
257
|
*/
|
|
253
258
|
origins?: string[];
|
|
254
259
|
}
|
|
255
|
-
export
|
|
260
|
+
export type WalletTypes = SolanaWallet | NearWallet | EthWallet;
|
|
261
|
+
export interface SolanaWalletProps {
|
|
256
262
|
wallet: SolanaWallet;
|
|
257
263
|
connection: Connection;
|
|
258
264
|
blockchain: 'solana';
|
|
259
265
|
}
|
|
260
|
-
export
|
|
266
|
+
export type CoinflowSolanaWithdrawProps = CoinflowCommonWithdrawProps & SolanaWalletProps;
|
|
267
|
+
export interface NearWalletProps {
|
|
261
268
|
wallet: NearWallet;
|
|
262
269
|
blockchain: 'near';
|
|
263
270
|
}
|
|
264
|
-
export
|
|
271
|
+
export type CoinflowNearWithdrawProps = CoinflowCommonWithdrawProps & NearWalletProps;
|
|
272
|
+
interface EvmWalletProps {
|
|
265
273
|
wallet: EthWallet;
|
|
266
274
|
usePermit?: boolean;
|
|
267
275
|
}
|
|
268
|
-
|
|
276
|
+
type CoinflowEvmWithdrawProps = CoinflowCommonWithdrawProps & EvmWalletProps;
|
|
277
|
+
export interface EthWalletProps {
|
|
269
278
|
blockchain: 'eth';
|
|
270
|
-
usePermit?: boolean;
|
|
271
279
|
}
|
|
272
|
-
export
|
|
280
|
+
export type CoinflowEthWithdrawProps = CoinflowEvmWithdrawProps & EthWalletProps;
|
|
281
|
+
export interface PolygonWalletProps {
|
|
273
282
|
blockchain: 'polygon';
|
|
274
283
|
}
|
|
275
|
-
export
|
|
284
|
+
export type CoinflowPolygonWithdrawProps = CoinflowEvmWithdrawProps & PolygonWalletProps;
|
|
285
|
+
export interface BaseWalletProps {
|
|
276
286
|
blockchain: 'base';
|
|
277
287
|
}
|
|
278
|
-
export
|
|
288
|
+
export type CoinflowBaseWithdrawProps = CoinflowEvmWithdrawProps & BaseWalletProps;
|
|
289
|
+
export interface ArbitrumWalletProps {
|
|
279
290
|
blockchain: 'arbitrum';
|
|
280
291
|
}
|
|
281
|
-
export type
|
|
292
|
+
export type CoinflowArbitrumWithdrawProps = CoinflowEvmWithdrawProps & ArbitrumWalletProps;
|
|
293
|
+
export interface CoinflowSessionKeyWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
294
|
+
sessionKey: string;
|
|
295
|
+
signer: SolanaWalletProps | NearWalletProps | EthWalletProps | PolygonWalletProps | BaseWalletProps | ArbitrumWalletProps;
|
|
296
|
+
blockchain?: undefined;
|
|
297
|
+
}
|
|
298
|
+
export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps | CoinflowBaseWithdrawProps | CoinflowArbitrumWithdrawProps | CoinflowSessionKeyWithdrawProps;
|
|
282
299
|
export interface CommonEvmRedeem {
|
|
283
300
|
waitForHash?: boolean;
|
|
284
301
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AA+ND,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,2DAA6B,CAAA;IAC7B,qDAAuB,CAAA;AACzB,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AA6RD,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "React Native Component for Coinflow",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/react": "^18.2.64",
|
|
44
44
|
"eslint-config-react-app": "^7.0.1",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.6.3",
|
|
46
46
|
"@solana/wallet-adapter-react": "^0.15.32",
|
|
47
47
|
"@near-wallet-selector/core": "^8.9.3"
|
|
48
48
|
},
|