@gearbox-protocol/sdk 13.0.0-next.24 → 13.0.0-next.25

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.
@@ -68,7 +68,7 @@ class TokensMeta extends import_utils.AddressMap {
68
68
  `extended token data not loaded for ${t.symbol} (${t.addr})`
69
69
  );
70
70
  }
71
- return "contractType" in t && t.contractType.startsWith("PHANTOM_TOKEN::");
71
+ return !!t.contractType?.startsWith("PHANTOM_TOKEN::");
72
72
  }
73
73
  /**
74
74
  * Returns true if the token is a KYC underlying token, throws if the token data is not loaded
@@ -81,7 +81,7 @@ class TokensMeta extends import_utils.AddressMap {
81
81
  `extended token data not loaded for ${t.symbol} (${t.addr})`
82
82
  );
83
83
  }
84
- return "contractType" in t && t.contractType.startsWith("KYC_UNDERLYING::");
84
+ return !!t.contractType?.startsWith("KYC_UNDERLYING::");
85
85
  }
86
86
  /**
87
87
  * Returns true if the token is a DSToken, throws if the token data is not loaded
@@ -206,7 +206,7 @@ class TokensMeta extends import_utils.AddressMap {
206
206
  `token ${meta.symbol} (${token}) is ${contractType} but serialize failed: ${serializeResp.error}`
207
207
  );
208
208
  }
209
- } else if (contractType.startsWith("PHANTOM_TOKEN::")) {
209
+ } else {
210
210
  this.upsert(token, {
211
211
  ...meta,
212
212
  contractType
@@ -56,7 +56,7 @@ class TokensMeta extends AddressMap {
56
56
  `extended token data not loaded for ${t.symbol} (${t.addr})`
57
57
  );
58
58
  }
59
- return "contractType" in t && t.contractType.startsWith("PHANTOM_TOKEN::");
59
+ return !!t.contractType?.startsWith("PHANTOM_TOKEN::");
60
60
  }
61
61
  /**
62
62
  * Returns true if the token is a KYC underlying token, throws if the token data is not loaded
@@ -69,7 +69,7 @@ class TokensMeta extends AddressMap {
69
69
  `extended token data not loaded for ${t.symbol} (${t.addr})`
70
70
  );
71
71
  }
72
- return "contractType" in t && t.contractType.startsWith("KYC_UNDERLYING::");
72
+ return !!t.contractType?.startsWith("KYC_UNDERLYING::");
73
73
  }
74
74
  /**
75
75
  * Returns true if the token is a DSToken, throws if the token data is not loaded
@@ -194,7 +194,7 @@ class TokensMeta extends AddressMap {
194
194
  `token ${meta.symbol} (${token}) is ${contractType} but serialize failed: ${serializeResp.error}`
195
195
  );
196
196
  }
197
- } else if (contractType.startsWith("PHANTOM_TOKEN::")) {
197
+ } else {
198
198
  this.upsert(token, {
199
199
  ...meta,
200
200
  contractType
@@ -8,6 +8,7 @@ export type KYCUnderlyingContractType = typeof KYC_UNDERLYING_DEFAULT | typeof K
8
8
  export type PhantomTokenContractType = (typeof PHANTOM_TOKEN_CONTRACT_TYPES)[number];
9
9
  export type SimpleTokenMeta = TokenData & {
10
10
  isDSToken?: boolean;
11
+ contractType?: string;
11
12
  };
12
13
  export type PhantomTokenMeta = SimpleTokenMeta & {
13
14
  contractType: PhantomTokenContractType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "13.0.0-next.24",
3
+ "version": "13.0.0-next.25",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",