@pioneer-platform/pioneer-sdk 4.21.10 → 4.21.11

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/dist/index.cjs CHANGED
@@ -2752,15 +2752,16 @@ class TransactionManager {
2752
2752
  this.events = events;
2753
2753
  }
2754
2754
  async classifyCaip(caip) {
2755
- if (SUPPORTED_CAIPS.UTXO.includes(caip))
2755
+ const caipString = typeof caip === "string" ? caip : String(caip);
2756
+ if (SUPPORTED_CAIPS.UTXO.includes(caipString))
2756
2757
  return "UTXO";
2757
- if (SUPPORTED_CAIPS.TENDERMINT.includes(caip))
2758
+ if (SUPPORTED_CAIPS.TENDERMINT.includes(caipString))
2758
2759
  return "TENDERMINT";
2759
- if (caip.startsWith("eip155"))
2760
+ if (caipString.startsWith("eip155"))
2760
2761
  return "EIP155";
2761
- if (SUPPORTED_CAIPS.OTHER.includes(caip))
2762
+ if (SUPPORTED_CAIPS.OTHER.includes(caipString))
2762
2763
  return "OTHER";
2763
- throw new Error(`Unsupported CAIP: ${caip}`);
2764
+ throw new Error(`Unsupported CAIP: ${caipString}`);
2764
2765
  }
2765
2766
  async transfer({ caip, to, amount, memo, isMax = false, feeLevel = 5, changeScriptType }) {
2766
2767
  let tag6 = TAG5 + " | transfer | ";
package/dist/index.es.js CHANGED
@@ -2928,15 +2928,16 @@ class TransactionManager {
2928
2928
  this.events = events;
2929
2929
  }
2930
2930
  async classifyCaip(caip) {
2931
- if (SUPPORTED_CAIPS.UTXO.includes(caip))
2931
+ const caipString = typeof caip === "string" ? caip : String(caip);
2932
+ if (SUPPORTED_CAIPS.UTXO.includes(caipString))
2932
2933
  return "UTXO";
2933
- if (SUPPORTED_CAIPS.TENDERMINT.includes(caip))
2934
+ if (SUPPORTED_CAIPS.TENDERMINT.includes(caipString))
2934
2935
  return "TENDERMINT";
2935
- if (caip.startsWith("eip155"))
2936
+ if (caipString.startsWith("eip155"))
2936
2937
  return "EIP155";
2937
- if (SUPPORTED_CAIPS.OTHER.includes(caip))
2938
+ if (SUPPORTED_CAIPS.OTHER.includes(caipString))
2938
2939
  return "OTHER";
2939
- throw new Error(`Unsupported CAIP: ${caip}`);
2940
+ throw new Error(`Unsupported CAIP: ${caipString}`);
2940
2941
  }
2941
2942
  async transfer({ caip, to, amount, memo, isMax = false, feeLevel = 5, changeScriptType }) {
2942
2943
  let tag6 = TAG5 + " | transfer | ";
package/dist/index.js CHANGED
@@ -2928,15 +2928,16 @@ class TransactionManager {
2928
2928
  this.events = events;
2929
2929
  }
2930
2930
  async classifyCaip(caip) {
2931
- if (SUPPORTED_CAIPS.UTXO.includes(caip))
2931
+ const caipString = typeof caip === "string" ? caip : String(caip);
2932
+ if (SUPPORTED_CAIPS.UTXO.includes(caipString))
2932
2933
  return "UTXO";
2933
- if (SUPPORTED_CAIPS.TENDERMINT.includes(caip))
2934
+ if (SUPPORTED_CAIPS.TENDERMINT.includes(caipString))
2934
2935
  return "TENDERMINT";
2935
- if (caip.startsWith("eip155"))
2936
+ if (caipString.startsWith("eip155"))
2936
2937
  return "EIP155";
2937
- if (SUPPORTED_CAIPS.OTHER.includes(caip))
2938
+ if (SUPPORTED_CAIPS.OTHER.includes(caipString))
2938
2939
  return "OTHER";
2939
- throw new Error(`Unsupported CAIP: ${caip}`);
2940
+ throw new Error(`Unsupported CAIP: ${caipString}`);
2940
2941
  }
2941
2942
  async transfer({ caip, to, amount, memo, isMax = false, feeLevel = 5, changeScriptType }) {
2942
2943
  let tag6 = TAG5 + " | transfer | ";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "highlander",
3
3
  "name": "@pioneer-platform/pioneer-sdk",
4
- "version": "4.21.10",
4
+ "version": "4.21.11",
5
5
  "dependencies": {
6
6
  "@keepkey/keepkey-sdk": "^0.2.62",
7
7
  "@pioneer-platform/loggerdog": "^8.11.0",
@@ -48,8 +48,6 @@
48
48
  },
49
49
  "react-native": "./src/index.ts",
50
50
  "repository": "https://github.com/thorswap/SwapKit.git",
51
- "type": "module",
52
- "types": "./dist/index.d.ts",
53
51
  "scripts": {
54
52
  "build": "bash scripts/build.sh",
55
53
  "build:watch": "nodemon --watch src --exec 'bun run build'",
@@ -57,5 +55,7 @@
57
55
  "lint": "eslint ./ --ext .ts,.tsx --fix; tsc --noEmit",
58
56
  "test": "echo 'vitest --run'",
59
57
  "test:coverage": "echo 'vitest run --coverage'"
60
- }
61
- }
58
+ },
59
+ "type": "module",
60
+ "types": "./dist/index.d.ts"
61
+ }
@@ -46,11 +46,14 @@ export class TransactionManager {
46
46
  }
47
47
 
48
48
  async classifyCaip(caip: string): Promise<string> {
49
- if (SUPPORTED_CAIPS.UTXO.includes(caip)) return 'UTXO';
50
- if (SUPPORTED_CAIPS.TENDERMINT.includes(caip)) return 'TENDERMINT';
51
- if (caip.startsWith('eip155')) return 'EIP155';
52
- if (SUPPORTED_CAIPS.OTHER.includes(caip)) return 'OTHER';
53
- throw new Error(`Unsupported CAIP: ${caip}`);
49
+ // Ensure caip is a string (handle case where it might be an object)
50
+ const caipString = typeof caip === 'string' ? caip : String(caip);
51
+
52
+ if (SUPPORTED_CAIPS.UTXO.includes(caipString)) return 'UTXO';
53
+ if (SUPPORTED_CAIPS.TENDERMINT.includes(caipString)) return 'TENDERMINT';
54
+ if (caipString.startsWith('eip155')) return 'EIP155';
55
+ if (SUPPORTED_CAIPS.OTHER.includes(caipString)) return 'OTHER';
56
+ throw new Error(`Unsupported CAIP: ${caipString}`);
54
57
  }
55
58
 
56
59
  async transfer({ caip, to, amount, memo, isMax = false, feeLevel = 5, changeScriptType }: any): Promise<any> {