@deserialize/multi-vm-wallet 1.0.371 → 1.1.0

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.
Files changed (79) hide show
  1. package/dist/bip32.d.ts +1 -3
  2. package/dist/bip32.js +103 -33
  3. package/dist/bip32.js.map +1 -1
  4. package/dist/bip32Old.d.ts +51 -0
  5. package/dist/bip32Old.js +856 -0
  6. package/dist/bip32Old.js.map +1 -0
  7. package/dist/{utils/bip32.d.ts → bip32Small.d.ts} +1 -3
  8. package/dist/bip32Small.js +115 -0
  9. package/dist/bip32Small.js.map +1 -0
  10. package/dist/bipTest.d.ts +0 -0
  11. package/dist/bipTest.js +363 -0
  12. package/dist/bipTest.js.map +1 -0
  13. package/dist/constant.d.ts +2 -0
  14. package/dist/constant.js +55 -0
  15. package/dist/constant.js.map +1 -0
  16. package/dist/evm/evm.d.ts +1 -0
  17. package/dist/evm/evm.js +1 -0
  18. package/dist/evm/evm.js.map +1 -1
  19. package/dist/evm/utils.d.ts +2 -1
  20. package/dist/evm/utils.js +24 -1
  21. package/dist/evm/utils.js.map +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/svm/svm.d.ts +1 -0
  26. package/dist/svm/svm.js +12 -8
  27. package/dist/svm/svm.js.map +1 -1
  28. package/dist/svm/transactionSender.js +6 -2
  29. package/dist/svm/transactionSender.js.map +1 -1
  30. package/dist/svm/utils.d.ts +1 -0
  31. package/dist/svm/utils.js +28 -35
  32. package/dist/svm/utils.js.map +1 -1
  33. package/dist/test.d.ts +2 -0
  34. package/dist/test.js +42 -0
  35. package/dist/test.js.map +1 -0
  36. package/dist/types.d.ts +2 -0
  37. package/dist/types.js.map +1 -1
  38. package/dist/vm.d.ts +2 -1
  39. package/dist/vm.js +2 -2
  40. package/dist/vm.js.map +1 -1
  41. package/package.json +2 -5
  42. package/utils/bip32.ts +124 -35
  43. package/utils/bip32Old.ts +1004 -0
  44. package/utils/bip32Small.ts +91 -0
  45. package/utils/bipTest.ts +442 -0
  46. package/utils/constant.ts +55 -0
  47. package/utils/evm/evm.ts +4 -3
  48. package/utils/evm/utils.ts +29 -1
  49. package/utils/index.ts +2 -1
  50. package/utils/svm/svm.ts +14 -12
  51. package/utils/svm/transactionSender.ts +7 -2
  52. package/utils/svm/utils.ts +36 -36
  53. package/utils/test.ts +49 -0
  54. package/utils/types.ts +2 -0
  55. package/utils/vm.ts +4 -3
  56. package/dist/tsconfig.tsbuildinfo +0 -1
  57. package/dist/utils/IChainWallet.d.ts +0 -17
  58. package/dist/utils/IChainWallet.js +0 -22
  59. package/dist/utils/bip32.js +0 -99
  60. package/dist/utils/evm/evm.d.ts +0 -39
  61. package/dist/utils/evm/evm.js +0 -233
  62. package/dist/utils/evm/index.d.ts +0 -2
  63. package/dist/utils/evm/index.js +0 -18
  64. package/dist/utils/evm/utils.d.ts +0 -207
  65. package/dist/utils/evm/utils.js +0 -537
  66. package/dist/utils/index.d.ts +0 -7
  67. package/dist/utils/index.js +0 -23
  68. package/dist/utils/svm/index.d.ts +0 -1
  69. package/dist/utils/svm/index.js +0 -17
  70. package/dist/utils/svm/svm.d.ts +0 -36
  71. package/dist/utils/svm/svm.js +0 -166
  72. package/dist/utils/svm/transactionSender.d.ts +0 -8
  73. package/dist/utils/svm/transactionSender.js +0 -83
  74. package/dist/utils/svm/utils.d.ts +0 -85
  75. package/dist/utils/svm/utils.js +0 -304
  76. package/dist/utils/types.d.ts +0 -44
  77. package/dist/utils/types.js +0 -9
  78. package/dist/utils/vm.d.ts +0 -12
  79. package/dist/utils/vm.js +0 -48
@@ -1,44 +0,0 @@
1
- import BN from "bn.js";
2
- import { EVMVM } from "./evm";
3
- import { SVMVM } from "./svm";
4
- export interface ChainWalletConfig {
5
- chainId: string | number;
6
- name: string;
7
- rpcUrl: string;
8
- explorerUrl: string;
9
- nativeToken: {
10
- name: string;
11
- symbol: string;
12
- decimals: number;
13
- };
14
- confirmationNo?: number;
15
- testnet?: boolean;
16
- }
17
- export interface TokenInfo {
18
- address: string;
19
- name: string;
20
- symbol: string;
21
- decimals: number;
22
- }
23
- export interface NFTInfo {
24
- tokenId: string;
25
- contractAddress: string;
26
- name?: string;
27
- description?: string;
28
- image?: string;
29
- }
30
- export interface TransactionResult {
31
- hash: string;
32
- success: boolean;
33
- error?: string;
34
- }
35
- export interface Balance {
36
- balance: BN;
37
- formatted: number;
38
- decimal: number;
39
- }
40
- export declare const SUPPORTED_VM: {
41
- readonly EVM: typeof EVMVM;
42
- readonly SVM: typeof SVMVM;
43
- };
44
- export type vmTypes = keyof typeof SUPPORTED_VM;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SUPPORTED_VM = void 0;
4
- const evm_1 = require("./evm");
5
- const svm_1 = require("./svm");
6
- exports.SUPPORTED_VM = {
7
- 'EVM': evm_1.EVMVM,
8
- 'SVM': svm_1.SVMVM
9
- };
@@ -1,12 +0,0 @@
1
- import { vmTypes } from "./types";
2
- export declare abstract class VM<AddressType, PrivateKeyType, ConnectionType> {
3
- protected seed: string;
4
- type: vmTypes;
5
- constructor(seed: string, vm: vmTypes);
6
- static mnemonicToSeed: (mnemonic: string) => string;
7
- abstract derivationPath: string;
8
- abstract generatePrivateKey(index: number, mnemonic?: string, derivationPath?: string): {
9
- privateKey: PrivateKeyType;
10
- index: number;
11
- };
12
- }
package/dist/utils/vm.js DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.VM = void 0;
37
- const bip39 = __importStar(require("bip39"));
38
- // Abstract Base Classes
39
- class VM {
40
- constructor(seed, vm) {
41
- this.type = vm;
42
- this.seed = seed;
43
- }
44
- }
45
- exports.VM = VM;
46
- VM.mnemonicToSeed = (mnemonic) => {
47
- return bip39.mnemonicToSeedSync(mnemonic).toString("hex");
48
- };