@txnlab/use-wallet 2.6.1 → 2.6.2

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 CHANGED
@@ -504,10 +504,9 @@ useEffect(() => {
504
504
  - Website - https://lute.app/
505
505
  - Install dependency - `npm install lute-connect`
506
506
 
507
-
508
507
  ### Kibisis Wallet
509
508
 
510
- ***NOTE:** Kibisis is in active development and currently only supports betanet and testnet.*
509
+ **\*NOTE:** Kibisis is in active development and currently only supports betanet and testnet.\*
511
510
 
512
511
  - Website - https://kibis.is
513
512
  - Download - https://kibis.is/#download
@@ -660,7 +659,8 @@ import { PeraWalletConnect } from '@perawallet/connect'
660
659
  import { DaffiWalletConnect } from '@daffiwallet/connect'
661
660
  import { WalletConnectModalSign } from '@walletconnect/modal-sign-html'
662
661
  import LuteConnect from 'lute-connect'
663
- import { Magic } from 'magic-sdk';
662
+ import { Magic } from 'magic-sdk'
663
+ import { AlgorandExtension } from '@magic-ext/algorand'
664
664
 
665
665
  export default function App() {
666
666
  const providers = useInitializeProviders({
@@ -694,9 +694,10 @@ export default function App() {
694
694
  },
695
695
  {
696
696
  id: PROVIDER_ID.MAGIC,
697
- getDynamicClient: Magic,
698
- clientOptions: { apiKey: 'API_KEY' },
699
- },
697
+ clientStatic: Magic,
698
+ extensionStatic: AlgorandExtension,
699
+ clientOptions: { apiKey: '<API_KEY>' }
700
+ }
700
701
  ],
701
702
  nodeConfig: {
702
703
  network: 'mainnet',
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('react');
4
- var algorand = require('@magic-ext/algorand');
5
4
  var buffer = require('buffer');
6
5
 
7
6
  exports.PROVIDER_ID = void 0;
@@ -2639,7 +2638,7 @@ class MagicAuth extends BaseClient {
2639
2638
  icon: ICON$4,
2640
2639
  isWalletConnect: true
2641
2640
  };
2642
- static async init({ clientOptions, algodOptions, clientStatic, getDynamicClient, algosdkStatic, network = DEFAULT_NETWORK }) {
2641
+ static async init({ clientOptions, algodOptions, clientStatic, getDynamicClient, extensionStatic, getDynamicExtension, algosdkStatic, network = DEFAULT_NETWORK }) {
2643
2642
  try {
2644
2643
  debugLog(`${exports.PROVIDER_ID.MAGIC.toUpperCase()} initializing...`);
2645
2644
  let Magic;
@@ -2649,17 +2648,27 @@ class MagicAuth extends BaseClient {
2649
2648
  else if (getDynamicClient) {
2650
2649
  Magic = await getDynamicClient();
2651
2650
  }
2652
- else if (!clientOptions || !clientOptions.apiKey) {
2653
- throw new Error('Magic provider missing API Key to be passed by required property: clientOptions');
2654
- }
2655
2651
  else {
2656
2652
  throw new Error('Magic provider missing required property: clientStatic or getDynamicClient');
2657
2653
  }
2654
+ let AlgorandExtension;
2655
+ if (extensionStatic) {
2656
+ AlgorandExtension = extensionStatic;
2657
+ }
2658
+ else if (getDynamicExtension) {
2659
+ AlgorandExtension = await getDynamicExtension();
2660
+ }
2661
+ else {
2662
+ throw new Error('Magic provider missing required property: extensionStatic or getDynamicExtension');
2663
+ }
2664
+ if (!clientOptions || !clientOptions.apiKey) {
2665
+ throw new Error('Magic provider missing API Key to be passed by required property: clientOptions');
2666
+ }
2658
2667
  const algosdk = algosdkStatic || (await Algod.init(algodOptions)).algosdk;
2659
2668
  const algodClient = getAlgodClient(algosdk, algodOptions);
2660
2669
  const magic = new Magic(clientOptions?.apiKey, {
2661
2670
  extensions: {
2662
- algorand: new algorand.AlgorandExtension({
2671
+ algorand: new AlgorandExtension({
2663
2672
  rpcUrl: ''
2664
2673
  })
2665
2674
  }