coreum-js 2.5.1 → 2.5.4
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/README.md +26 -9
- package/dist/main/client/index.d.ts +53 -8
- package/dist/main/client/index.js +52 -8
- package/dist/main/index.d.ts +1 -2
- package/dist/main/index.js +4 -3
- package/dist/main/services/cosmostation.js +1 -10
- package/dist/main/types/core.d.ts +1 -1
- package/dist/main/types/coreum.js +1 -12
- package/dist/main/types/signing.d.ts +2 -1
- package/dist/main/types/signing.js +2 -1
- package/dist/main/utils/calculations.d.ts +15 -0
- package/dist/main/utils/calculations.js +16 -1
- package/dist/main/utils/event.d.ts +5 -0
- package/dist/main/utils/event.js +6 -1
- package/dist/main/utils/ft.d.ts +5 -0
- package/dist/main/utils/ft.js +6 -1
- package/dist/main/utils/nft.d.ts +11 -1
- package/dist/main/utils/nft.js +12 -2
- package/dist/main/utils/wallet.d.ts +11 -1
- package/dist/main/utils/wallet.js +13 -7
- package/dist/module/client/index.d.ts +53 -8
- package/dist/module/client/index.js +50 -6
- package/dist/module/index.d.ts +1 -2
- package/dist/module/index.js +2 -3
- package/dist/module/services/cosmostation.js +1 -10
- package/dist/module/types/core.d.ts +1 -1
- package/dist/module/types/coreum.js +1 -12
- package/dist/module/types/signing.d.ts +2 -1
- package/dist/module/types/signing.js +2 -1
- package/dist/module/utils/calculations.d.ts +15 -0
- package/dist/module/utils/calculations.js +16 -1
- package/dist/module/utils/event.d.ts +5 -0
- package/dist/module/utils/event.js +6 -1
- package/dist/module/utils/ft.d.ts +5 -0
- package/dist/module/utils/ft.js +6 -1
- package/dist/module/utils/nft.d.ts +11 -1
- package/dist/module/utils/nft.js +12 -2
- package/dist/module/utils/wallet.d.ts +11 -1
- package/dist/module/utils/wallet.js +12 -5
- package/package.json +3 -2
|
@@ -2,6 +2,11 @@ import { DirectSecp256k1HdWallet, } from "@cosmjs/proto-signing";
|
|
|
2
2
|
import { stringToPath } from "@cosmjs/crypto";
|
|
3
3
|
import { bech32 } from "bech32";
|
|
4
4
|
import { CoreumPrefixes } from "../types/coreum";
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param address String representing an address on the Coreum blockchain
|
|
8
|
+
* @returns A boolean defining if the passed address is a valid address on the Coreum Blockchain
|
|
9
|
+
*/
|
|
5
10
|
export const isValidCoreumAddress = (address) => {
|
|
6
11
|
try {
|
|
7
12
|
const { prefix = null } = bech32.decode(address);
|
|
@@ -16,10 +21,12 @@ export const isValidCoreumAddress = (address) => {
|
|
|
16
21
|
return false;
|
|
17
22
|
}
|
|
18
23
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param mnemonic Mnemonic words of a Cosmos SDK wallet
|
|
27
|
+
* @param prefix The prefix to use - "core" | "testcore" | "devcore"
|
|
28
|
+
* @returns A wallet with the default hdPath for the Coreum Blockchain, and with the selected prefix.
|
|
29
|
+
*/
|
|
23
30
|
export const generateWalletFromMnemonic = async (mnemonic, prefix) => {
|
|
24
31
|
const hdPath = "m/44'/990'/0'/0/0";
|
|
25
32
|
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
|
|
@@ -28,4 +35,4 @@ export const generateWalletFromMnemonic = async (mnemonic, prefix) => {
|
|
|
28
35
|
});
|
|
29
36
|
return wallet;
|
|
30
37
|
};
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
38
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FsbGV0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL3dhbGxldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEdBRXhCLE1BQU0sdUJBQXVCLENBQUM7QUFDL0IsT0FBTyxFQUFFLFlB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UFDLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coreum-js",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "JS/TS Library to to easily make use of the Coreum Blockchain",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:version": "npm run build && standard-version && git add -A",
|
|
11
11
|
"build:main": "npx tsc -p tsconfig.json",
|
|
12
12
|
"build:module": "npx tsc -p tsconfig.module.json",
|
|
13
|
-
"generate:docs": "npx typedoc src/index.ts"
|
|
13
|
+
"generate:docs": "npx typedoc --plugin typedoc-plugin-missing-exports src/index.ts"
|
|
14
14
|
},
|
|
15
15
|
"pre-commit": [
|
|
16
16
|
"build:version"
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"standard-version": "^9.5.0",
|
|
51
51
|
"ts-node": "^10.9.1",
|
|
52
52
|
"typedoc": "^0.24.4",
|
|
53
|
+
"typedoc-plugin-missing-exports": "^2.0.0",
|
|
53
54
|
"typescript": "^5.0.2"
|
|
54
55
|
}
|
|
55
56
|
}
|