@sundaeswap/wallet-lite 0.0.88 → 0.0.90

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.88",
3
+ "version": "0.0.90",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -43,7 +43,8 @@ export class ReadOnlyApi implements Cip30WalletApi {
43
43
  };
44
44
 
45
45
  getUsedAddresses = async () => {
46
- return [];
46
+ const address = Cardano.Address.fromBech32(this.address);
47
+ return [address.toBytes()];
47
48
  };
48
49
 
49
50
  getUtxos = async () => {
@@ -40,6 +40,10 @@ export class ReadOnlyBlockfrostProvider implements ReadOnlyProvider {
40
40
  },
41
41
  ).then((res) => res.json());
42
42
 
43
+ if ("error" in result) {
44
+ return [];
45
+ }
46
+
43
47
  const formatted = result.map((r) => {
44
48
  return Serialization.TransactionUnspentOutput.fromCore([
45
49
  Serialization.TransactionInput.fromCore({
@@ -62,7 +66,16 @@ export class ReadOnlyBlockfrostProvider implements ReadOnlyProvider {
62
66
  return formatted;
63
67
  }
64
68
 
65
- private __getValueFromAmount(amount: { unit: string; quantity: string }[]) {
69
+ private __getValueFromAmount(amount?: { unit: string; quantity: string }[]) {
70
+ if (!amount) {
71
+ amount = [
72
+ {
73
+ unit: "lovelace",
74
+ quantity: "0",
75
+ },
76
+ ];
77
+ }
78
+
66
79
  const lovelace = amount.find((a) => a.unit === "lovelace");
67
80
  const assets = amount.filter((a) => a.unit !== "lovelace");
68
81