@firmachain/firma-js 0.2.44 → 0.2.45
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/sdk/FirmaConfig.js +1 -1
- package/dist/sdk/FirmaUtil.d.ts +2 -0
- package/dist/sdk/FirmaUtil.js +34 -0
- package/package.json +2 -1
package/dist/sdk/FirmaConfig.js
CHANGED
|
@@ -31,7 +31,7 @@ var FirmaConfig = /** @class */ (function () {
|
|
|
31
31
|
isShowLog: true,
|
|
32
32
|
};
|
|
33
33
|
FirmaConfig.TestNetConfig = {
|
|
34
|
-
chainID: "imperium-
|
|
34
|
+
chainID: "imperium-4",
|
|
35
35
|
rpcAddress: "https://lcd-testnet.firmachain.dev:26657",
|
|
36
36
|
restApiAddress: "https://lcd-testnet.firmachain.dev:1317",
|
|
37
37
|
ipfsNodeAddress: "https://ipfs-dev.firmachain.dev",
|
package/dist/sdk/FirmaUtil.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export declare class FirmaUtil {
|
|
|
29
29
|
static getSha1HashFromString(text: string): string;
|
|
30
30
|
static getHashFromString(text: string): string;
|
|
31
31
|
static isValidAddress(address: string): boolean;
|
|
32
|
+
static buf2hex(buffer: Uint8Array): string;
|
|
33
|
+
static getHexAddressFromAddress(address: string): string;
|
|
32
34
|
static getValOperAddressFromAccAddress(address: string): string;
|
|
33
35
|
static getAccAddressFromValOperAddress(address: string): string;
|
|
34
36
|
static getSignerDataForLedger(address: string): Promise<SignerData>;
|
package/dist/sdk/FirmaUtil.js
CHANGED
|
@@ -46,6 +46,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
+
if (!m) return o;
|
|
52
|
+
var i = m.call(o), r, ar = [], e;
|
|
53
|
+
try {
|
|
54
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
+
}
|
|
56
|
+
catch (error) { e = { error: error }; }
|
|
57
|
+
finally {
|
|
58
|
+
try {
|
|
59
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
+
}
|
|
61
|
+
finally { if (e) throw e.error; }
|
|
62
|
+
}
|
|
63
|
+
return ar;
|
|
64
|
+
};
|
|
65
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
+
if (ar || !(i in from)) {
|
|
68
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
+
ar[i] = from[i];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
|
+
};
|
|
49
74
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
75
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
76
|
};
|
|
@@ -186,6 +211,15 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
186
211
|
}
|
|
187
212
|
return false;
|
|
188
213
|
};
|
|
214
|
+
FirmaUtil.buf2hex = function (buffer) {
|
|
215
|
+
return __spreadArray([], __read(new Uint8Array(buffer)), false).map(function (x) { return x.toString(16).padStart(2, '0'); })
|
|
216
|
+
.join('');
|
|
217
|
+
};
|
|
218
|
+
// for evm address support
|
|
219
|
+
FirmaUtil.getHexAddressFromAddress = function (address) {
|
|
220
|
+
var data = encoding_1.Bech32.decode(address).data;
|
|
221
|
+
return "0x" + FirmaUtil.buf2hex(data);
|
|
222
|
+
};
|
|
189
223
|
FirmaUtil.getValOperAddressFromAccAddress = function (address) {
|
|
190
224
|
var data = encoding_1.Bech32.decode(address).data;
|
|
191
225
|
return encoding_1.Bech32.encode(FirmaUtil.config.prefix + "valoper", data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firmachain/firma-js",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.45",
|
|
4
4
|
"description": "The Official FirmaChain Javascript SDK written in Typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@cosmjs/math": "^0.26.0",
|
|
37
37
|
"@cosmjs/proto-signing": "^0.25.6",
|
|
38
38
|
"@cosmjs/tendermint-rpc": "^0.26.0",
|
|
39
|
+
"@tharsis/address-converter": "^0.1.8",
|
|
39
40
|
"@types/pako": "^2.0.0",
|
|
40
41
|
"axios": "^0.27.2",
|
|
41
42
|
"big-number": "^2.0.0",
|