@sundaeswap/wallet-lite 0.0.21 → 0.0.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sundaeswap/wallet-lite",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -1,5 +1,8 @@
1
1
  import type { TransactionUnspentOutput } from "@cardano-sdk/core/dist/cjs/Serialization/index.js";
2
- import type { Cip30WalletApi } from "@cardano-sdk/dapp-connector";
2
+ import type {
3
+ Cip30WalletApi,
4
+ GetCollateral,
5
+ } from "@cardano-sdk/dapp-connector";
3
6
  import { AssetAmount, type IAssetAmountMetadata } from "@sundaeswap/asset";
4
7
  import merge from "lodash/merge.js";
5
8
 
@@ -517,7 +520,16 @@ export class WalletObserver<
517
520
  }
518
521
 
519
522
  const [cbor, { Serialization }, { typedHex }] = await Promise.all([
520
- this.api.getCollateral(),
523
+ (async () => {
524
+ const funcCall =
525
+ this.api?.getCollateral ||
526
+ (this.api?.experimental.getCollateral as GetCollateral);
527
+ if (typeof funcCall !== "function") {
528
+ return [];
529
+ }
530
+
531
+ return await funcCall();
532
+ })(),
521
533
  getCardanoCore(),
522
534
  getCardanoUtil(),
523
535
  ]);