@dynamic-labs-wallet/stellar 1.1.79 → 1.1.80

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/index.cjs CHANGED
@@ -65,9 +65,12 @@ var STELLAR_NETWORK_PASSPHRASES = {
65
65
  '3': STELLAR_NETWORK_PASSPHRASES.FUTURENET
66
66
  };
67
67
  /**
68
- * Gets the network passphrase from a numeric chainId, defaults to mainnet
68
+ * Gets the network passphrase from a numeric chainId, throws for any chainId other than '1', '2' or '3'
69
69
  */ var getNetworkPassphraseFromChainId = function(chainId) {
70
- return STELLAR_CHAIN_ID_TO_PASSPHRASE[chainId] || STELLAR_NETWORK_PASSPHRASES.MAINNET;
70
+ if (!Object.keys(STELLAR_CHAIN_ID_TO_PASSPHRASE).includes(chainId)) {
71
+ throw new Error('Unsupported Stellar chainId');
72
+ }
73
+ return STELLAR_CHAIN_ID_TO_PASSPHRASE[chainId];
71
74
  };
72
75
 
73
76
  function _assert_this_initialized(self) {
package/index.esm.js CHANGED
@@ -45,9 +45,12 @@ var STELLAR_NETWORK_PASSPHRASES = {
45
45
  '3': STELLAR_NETWORK_PASSPHRASES.FUTURENET
46
46
  };
47
47
  /**
48
- * Gets the network passphrase from a numeric chainId, defaults to mainnet
48
+ * Gets the network passphrase from a numeric chainId, throws for any chainId other than '1', '2' or '3'
49
49
  */ var getNetworkPassphraseFromChainId = function(chainId) {
50
- return STELLAR_CHAIN_ID_TO_PASSPHRASE[chainId] || STELLAR_NETWORK_PASSPHRASES.MAINNET;
50
+ if (!Object.keys(STELLAR_CHAIN_ID_TO_PASSPHRASE).includes(chainId)) {
51
+ throw new Error('Unsupported Stellar chainId');
52
+ }
53
+ return STELLAR_CHAIN_ID_TO_PASSPHRASE[chainId];
51
54
  };
52
55
 
53
56
  function _assert_this_initialized(self) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/stellar",
3
- "version": "1.1.79",
3
+ "version": "1.1.80",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/browser": "1.1.79",
7
+ "@dynamic-labs-wallet/browser": "1.1.80",
8
8
  "@stellar/stellar-sdk": "^12.3.0",
9
9
  "@dynamic-labs/sdk-api-core": "0.167.0"
10
10
  },
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare const STELLAR_CHAIN_ID_TO_PASSPHRASE: Record<string, string>;
6
6
  /**
7
- * Gets the network passphrase from a numeric chainId, defaults to mainnet
7
+ * Gets the network passphrase from a numeric chainId, throws for any chainId other than '1', '2' or '3'
8
8
  */
9
9
  export declare const getNetworkPassphraseFromChainId: (chainId: string) => string;
10
10
  //# sourceMappingURL=getNetworkPassphrase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,MAEjE,CAAC"}
1
+ {"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,MAKjE,CAAC"}