@pioneer-platform/pioneer-react 0.2.37 → 0.2.39
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/dist/index.js +192215 -188205
- package/dist/manifest.json +1 -1
- package/package.json +2 -1
- package/public/manifest.json +1 -1
- package/src/lib/components/pioneer/index.tsx +1 -1
- package/src/lib/context/Pioneer/index.tsx +63 -19
- package/src/lib/pages/home/index.tsx +0 -1
- package/src/lib/pages/home/components/CTASection.tsx +0 -36
- package/src/lib/pages/home/components/SomeImage.tsx +0 -36
- package/src/lib/pages/home/components/SomeText.tsx +0 -16
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/pioneer-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.39",
|
|
4
4
|
"author": "highlander",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@keepkey/keepkey-sdk": "^0.2.48",
|
|
35
35
|
"@pioneer-platform/pioneer-client": "^9.0.6",
|
|
36
36
|
"@pioneer-sdk/sdk": "1.1.160",
|
|
37
|
+
"@pioneer-sdk/sdk-v2": "0.0.3",
|
|
37
38
|
"@shapeshiftoss/hdwallet-core": "^1.50.0",
|
|
38
39
|
"@shapeshiftoss/hdwallet-metamask": "^1.50.0",
|
|
39
40
|
"@shapeshiftoss/hdwallet-native": "^1.50.3",
|
package/public/manifest.json
CHANGED
|
@@ -42,6 +42,9 @@ import * as core from "@shapeshiftoss/hdwallet-core";
|
|
|
42
42
|
import {
|
|
43
43
|
enableShapeShiftSnap,
|
|
44
44
|
shapeShiftSnapInstalled,
|
|
45
|
+
BTCGetAddress as snapBitcoinGetAddress,
|
|
46
|
+
BTCGetPublicKeys as snapBitcoinGetPublicKeys,
|
|
47
|
+
BTCSignTransaction as snapBitcoinSignTransaction,
|
|
45
48
|
} from "@shapeshiftoss/metamask-snaps-adapter";
|
|
46
49
|
// import * as keplr from "@shapeshiftoss/hdwallet-keplr";
|
|
47
50
|
// import * as metaMask from "@shapeshiftoss/hdwallet-metamask";
|
|
@@ -353,24 +356,63 @@ export const PioneerProvider = ({
|
|
|
353
356
|
//@ts-ignore
|
|
354
357
|
walletMetaMask.accounts = accounts;
|
|
355
358
|
|
|
356
|
-
const successMetaMask = await appInit.pairWallet(walletMetaMask);
|
|
357
|
-
console.log("successMetaMask: ", successMetaMask);
|
|
358
|
-
if (successMetaMask) {
|
|
359
|
-
// @ts-ignore
|
|
360
|
-
if (appInit.pubkeyContext?.master || appInit?.pubkey) {
|
|
361
|
-
// @ts-ignore
|
|
362
|
-
dispatch({
|
|
363
|
-
type: WalletActions.SET_PUBKEY_CONTEXT,
|
|
364
|
-
// @ts-ignore
|
|
365
|
-
payload: appInit.pubkeyContext?.master || appInit?.pubkey,
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
359
|
// @ts-ignore
|
|
370
360
|
dispatch({
|
|
371
361
|
type: WalletActions.SET_STATUS,
|
|
372
362
|
payload: "MetaMask connected!",
|
|
373
363
|
});
|
|
364
|
+
//@ts-ignore
|
|
365
|
+
dispatch({ type: WalletActions.ADD_WALLET, payload: walletMetaMask });
|
|
366
|
+
|
|
367
|
+
appInit.pairWallet(walletMetaMask);
|
|
368
|
+
console.log("walletMetaMask: ", walletMetaMask);
|
|
369
|
+
//get btc address
|
|
370
|
+
// let accountInfo = await walletMetaMask.getAccountInfo("bitcoin");
|
|
371
|
+
// console.log("accountInfo: ", accountInfo);
|
|
372
|
+
|
|
373
|
+
//get pubkeys
|
|
374
|
+
// let pubkeys = await walletMetaMask.getPublicKeys([
|
|
375
|
+
// {
|
|
376
|
+
// addressNList: [0x80000000 + 44, 0x80000000 + 0, 0x80000000 + 0],
|
|
377
|
+
// curve: "secp256k1",
|
|
378
|
+
// showDisplay: true, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
379
|
+
// coin: "Bitcoin",
|
|
380
|
+
// }])
|
|
381
|
+
// console.log(pubkeys)
|
|
382
|
+
|
|
383
|
+
let address = await walletMetaMask.binanceGetAddress({
|
|
384
|
+
addressNList: [ 2147483692, 2147483648, 2147483648, 0, 4 ]
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
// let address = await walletMetaMask.btcGetAddress({
|
|
388
|
+
// addressNList: [ 2147483692, 2147483648, 2147483648, 0, 4 ],
|
|
389
|
+
// coin: 'Bitcoin',
|
|
390
|
+
// scriptType: 'p2pkh',
|
|
391
|
+
// showDisplay: false
|
|
392
|
+
// })
|
|
393
|
+
|
|
394
|
+
// let address = await walletMetaMask.btcGetAddress({
|
|
395
|
+
// addressNList: [ 2147483692, 2147483793, 2147483648, 0, 3 ],
|
|
396
|
+
// coin: 'BitcoinCash',
|
|
397
|
+
// scriptType: 'p2pkh',
|
|
398
|
+
// showDisplay: false
|
|
399
|
+
// })
|
|
400
|
+
console.log("METAMASK BTC ADDRESS: ", address);
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
// console.log("successMetaMask: ", successMetaMask);
|
|
404
|
+
// if (successMetaMask) {
|
|
405
|
+
// // @ts-ignore
|
|
406
|
+
// if (appInit.pubkeyContext?.master || appInit?.pubkey) {
|
|
407
|
+
// // @ts-ignore
|
|
408
|
+
// dispatch({
|
|
409
|
+
// type: WalletActions.SET_PUBKEY_CONTEXT,
|
|
410
|
+
// // @ts-ignore
|
|
411
|
+
// payload: appInit.pubkeyContext?.master || appInit?.pubkey,
|
|
412
|
+
// });
|
|
413
|
+
// }
|
|
414
|
+
// }
|
|
415
|
+
|
|
374
416
|
}
|
|
375
417
|
} else {
|
|
376
418
|
console.log("MetaMask is not available");
|
|
@@ -399,9 +441,6 @@ export const PioneerProvider = ({
|
|
|
399
441
|
KkRestAdapter.useKeyring(keyring).pairDevice(sdkKeepKey),
|
|
400
442
|
timeout(30000),
|
|
401
443
|
]);
|
|
402
|
-
// pair keepkey
|
|
403
|
-
const successKeepKey = await appInit.pairWallet(walletKeepKey);
|
|
404
|
-
//console.log("successKeepKey: ", successKeepKey);
|
|
405
444
|
//@ts-ignore
|
|
406
445
|
dispatch({ type: WalletActions.ADD_WALLET, payload: walletKeepKey });
|
|
407
446
|
// @ts-ignore
|
|
@@ -409,6 +448,10 @@ export const PioneerProvider = ({
|
|
|
409
448
|
type: WalletActions.SET_STATUS,
|
|
410
449
|
payload: "KeepKey connected!",
|
|
411
450
|
});
|
|
451
|
+
// pair keepkey
|
|
452
|
+
appInit.pairWallet(walletKeepKey);
|
|
453
|
+
//console.log("successKeepKey: ", successKeepKey);
|
|
454
|
+
|
|
412
455
|
} catch (error) {
|
|
413
456
|
//@ts-ignore
|
|
414
457
|
console.error("Error or Timeout:", error.message);
|
|
@@ -430,9 +473,7 @@ export const PioneerProvider = ({
|
|
|
430
473
|
await nativeAdapter.initialize();
|
|
431
474
|
// @ts-ignore
|
|
432
475
|
await walletSoftware.loadDevice({ mnemonic });
|
|
433
|
-
|
|
434
|
-
const successSoftware = await appInit.pairWallet(walletSoftware);
|
|
435
|
-
console.log("successSoftware: ", successSoftware);
|
|
476
|
+
|
|
436
477
|
// @ts-ignore
|
|
437
478
|
dispatch({ type: WalletActions.ADD_WALLET, payload: walletSoftware });
|
|
438
479
|
// @ts-ignore
|
|
@@ -440,6 +481,9 @@ export const PioneerProvider = ({
|
|
|
440
481
|
type: WalletActions.SET_STATUS,
|
|
441
482
|
payload: "Software wallet connected!",
|
|
442
483
|
});
|
|
484
|
+
|
|
485
|
+
console.log("walletSoftware: ", walletSoftware);
|
|
486
|
+
appInit.pairWallet(walletSoftware);
|
|
443
487
|
}
|
|
444
488
|
|
|
445
489
|
|
|
@@ -23,7 +23,6 @@ const Home = () => {
|
|
|
23
23
|
const [modalType, setModalType] = useState("");
|
|
24
24
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
useEffect(() => {
|
|
28
27
|
console.log("2 pubkeyContext: ", pubkeyContext);
|
|
29
28
|
setAddress(pubkeyContext.master || pubkeyContext.pubkey || pubkeyContext);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Box, Button, Flex, Image, Link } from "@chakra-ui/react";
|
|
2
|
-
import { AiFillGithub } from "react-icons/ai";
|
|
3
|
-
|
|
4
|
-
const CTASection = () => (
|
|
5
|
-
<Box textAlign="center">
|
|
6
|
-
<Link
|
|
7
|
-
_hover={undefined}
|
|
8
|
-
href="https://github.com/BitHighlander/pioneer-template"
|
|
9
|
-
>
|
|
10
|
-
<Button leftIcon={<AiFillGithub />} size="sm">
|
|
11
|
-
Open in Github
|
|
12
|
-
</Button>
|
|
13
|
-
</Link>
|
|
14
|
-
<Flex marginY={4} justifyContent="center" gridGap={2}>
|
|
15
|
-
<Link
|
|
16
|
-
aria-label="Deploy to Vercel"
|
|
17
|
-
isExternal
|
|
18
|
-
href="https://vercel.com/import/git?s=https://github.com/BitHighlander/pioneer-template"
|
|
19
|
-
>
|
|
20
|
-
<Image src="https://vercel.com/button" alt="Vercel deploy button" />
|
|
21
|
-
</Link>
|
|
22
|
-
<Link
|
|
23
|
-
aria-label="Deploy to Netlify"
|
|
24
|
-
isExternal
|
|
25
|
-
href="https://app.netlify.com/start/deploy?repository=https://github.com/BitHighlander/pioneer-template"
|
|
26
|
-
>
|
|
27
|
-
<Image
|
|
28
|
-
src="https://www.netlify.com/img/deploy/button.svg"
|
|
29
|
-
alt="Netlify deploy button"
|
|
30
|
-
/>
|
|
31
|
-
</Link>
|
|
32
|
-
</Flex>
|
|
33
|
-
</Box>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export default CTASection;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Flex, Image } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
const ICON_SIZE = 22;
|
|
4
|
-
|
|
5
|
-
const SomeImage = () => {
|
|
6
|
-
return (
|
|
7
|
-
<Flex marginY={4} justifyContent="center" alignItems="center" gridGap={2}>
|
|
8
|
-
<Image
|
|
9
|
-
src="/assets/vite-logo.svg"
|
|
10
|
-
title="vite"
|
|
11
|
-
height={ICON_SIZE}
|
|
12
|
-
width={ICON_SIZE}
|
|
13
|
-
/>
|
|
14
|
-
<Image
|
|
15
|
-
src="/assets/react-icon.svg"
|
|
16
|
-
title="react"
|
|
17
|
-
height={ICON_SIZE}
|
|
18
|
-
width={ICON_SIZE}
|
|
19
|
-
/>
|
|
20
|
-
<Image
|
|
21
|
-
src="/assets/chakra-ui-logomark-colored.svg"
|
|
22
|
-
title="Chakra UI"
|
|
23
|
-
height={ICON_SIZE}
|
|
24
|
-
width={ICON_SIZE}
|
|
25
|
-
/>
|
|
26
|
-
<Image
|
|
27
|
-
src="/assets/ts-logo-512.svg"
|
|
28
|
-
title="TypeScript"
|
|
29
|
-
height={ICON_SIZE}
|
|
30
|
-
width={ICON_SIZE}
|
|
31
|
-
/>
|
|
32
|
-
</Flex>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default SomeImage;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Grid, Heading, Text } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
const SomeText = () => {
|
|
4
|
-
return (
|
|
5
|
-
<Grid textAlign="center" gap={2}>
|
|
6
|
-
<Heading fontSize="2xl" fontWeight="extrabold">
|
|
7
|
-
Pioneer Template
|
|
8
|
-
</Heading>
|
|
9
|
-
<Text color="gray.500" fontSize="sm">
|
|
10
|
-
The Most Powerful Template for Building on Crypto
|
|
11
|
-
</Text>
|
|
12
|
-
</Grid>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default SomeText;
|