@akashnetwork/chain-sdk 1.0.0-alpha.15 → 1.0.0-alpha.16
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 +12 -2
- package/dist/cjs/encoding/customTypes/LegacyDec.cjs +15 -2
- package/dist/cjs/encoding/customTypes/LegacyDec.cjs.map +2 -2
- package/dist/esm/{chunk-FGGGKBTA.js → chunk-CIAGNQVY.js} +2 -2
- package/dist/esm/{chunk-HWEQHYDS.js → chunk-PJXRRT4L.js} +2 -2
- package/dist/esm/{chunk-ES23CJFI.js → chunk-TRASWQID.js} +2 -2
- package/dist/esm/chunk-WEZWIYX4.js +27 -0
- package/dist/esm/chunk-WEZWIYX4.js.map +7 -0
- package/dist/esm/{chunk-BGUZX6M6.js → chunk-YY3I7UCT.js} +2 -2
- package/dist/esm/generated/protos/index.akash.v1.js +3 -3
- package/dist/esm/generated/protos/index.akash.v1beta4.js +3 -3
- package/dist/esm/generated/protos/index.akash.v1beta5.js +3 -3
- package/dist/esm/generated/protos/index.cosmos.v1.js +3 -3
- package/dist/esm/generated/protos/index.cosmos.v1beta1.js +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.web.js +3 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/cjs/test.cjs +0 -182
- package/dist/cjs/test.cjs.map +0 -7
- package/dist/esm/chunk-SI3KSDHG.js +0 -14
- package/dist/esm/chunk-SI3KSDHG.js.map +0 -7
- package/dist/types/test.d.ts +0 -1
- /package/dist/esm/{chunk-FGGGKBTA.js.map → chunk-CIAGNQVY.js.map} +0 -0
- /package/dist/esm/{chunk-HWEQHYDS.js.map → chunk-PJXRRT4L.js.map} +0 -0
- /package/dist/esm/{chunk-ES23CJFI.js.map → chunk-TRASWQID.js.map} +0 -0
- /package/dist/esm/{chunk-BGUZX6M6.js.map → chunk-YY3I7UCT.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Akash API TypeScript Bindings
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/%40akashnetwork%2Fchain-sdk)
|
|
4
4
|
[](https://opensource.org/license/apache-2-0)
|
|
5
5
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
6
|
|
|
@@ -8,10 +8,20 @@ This package provides TypeScript bindings for the Akash API, generated from prot
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
+
⚠️ **NOTICE:**
|
|
12
|
+
|
|
13
|
+
The new Chain SDK for TypeScript is currently in alpha. As such, small breaking changes may occur between versions.
|
|
14
|
+
To ensure stability of your own scripts, pin a specific version of the SDK in your package.json (avoid using `^` or `~` in front of version).
|
|
15
|
+
|
|
16
|
+
We are actively gathering developer feedback and improving the DX (Developer Experience).
|
|
17
|
+
Please report any issues or suggestions via:
|
|
18
|
+
* GitHub Issues (preferred)
|
|
19
|
+
* [Discord](https://akash.network/docs/getting-started/technical-support/)
|
|
20
|
+
|
|
11
21
|
To install the package, run:
|
|
12
22
|
|
|
13
23
|
```bash
|
|
14
|
-
npm install @akashnetwork/chain-sdk
|
|
24
|
+
npm install @akashnetwork/chain-sdk@alpha
|
|
15
25
|
```
|
|
16
26
|
|
|
17
27
|
## Usage
|
|
@@ -26,7 +26,20 @@ const PRECISION = 18;
|
|
|
26
26
|
const LegacyDec = {
|
|
27
27
|
typeName: "cosmossdk.io/math.LegacyDec",
|
|
28
28
|
shortName: "LegacyDec",
|
|
29
|
-
encode
|
|
30
|
-
|
|
29
|
+
encode(value) {
|
|
30
|
+
if (!value.length) return "";
|
|
31
|
+
const { sign, value: positiveValue } = unsignedDecimal(value);
|
|
32
|
+
return sign + import_math.Decimal.fromUserInput(positiveValue, PRECISION).atomics;
|
|
33
|
+
},
|
|
34
|
+
decode(value) {
|
|
35
|
+
if (!value.length) return "";
|
|
36
|
+
const { sign, value: positiveValue } = unsignedDecimal(value);
|
|
37
|
+
return sign + import_math.Decimal.fromAtomics(positiveValue, PRECISION).toString();
|
|
38
|
+
}
|
|
31
39
|
};
|
|
40
|
+
function unsignedDecimal(value) {
|
|
41
|
+
if (value[0] !== "-") return { sign: "", value };
|
|
42
|
+
const positiveValue = value.slice(1);
|
|
43
|
+
return { sign: "-", value: positiveValue };
|
|
44
|
+
}
|
|
32
45
|
//# sourceMappingURL=LegacyDec.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/encoding/customTypes/LegacyDec.ts"],
|
|
4
|
-
"sourcesContent": ["import { Decimal } from \"@cosmjs/math\";\n\nimport type { CustomType } from \"./CustomType.ts\";\n\n/**\n * @see https://github.com/cosmos/cosmos-sdk/blob/25b14c3caa2ecdc99840dbb88fdb3a2d8ac02158/math/dec.go#L21\n */\nconst PRECISION = 18;\n\nexport const LegacyDec = {\n typeName: \"cosmossdk.io/math.LegacyDec\",\n shortName: \"LegacyDec\",\n encode
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAOxB,MAAM,YAAY;AAEX,MAAM,YAAY;AAAA,EACvB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,
|
|
4
|
+
"sourcesContent": ["import { Decimal } from \"@cosmjs/math\";\n\nimport type { CustomType } from \"./CustomType.ts\";\n\n/**\n * @see https://github.com/cosmos/cosmos-sdk/blob/25b14c3caa2ecdc99840dbb88fdb3a2d8ac02158/math/dec.go#L21\n */\nconst PRECISION = 18;\n\nexport const LegacyDec = {\n typeName: \"cosmossdk.io/math.LegacyDec\",\n shortName: \"LegacyDec\",\n encode(value: string) {\n if (!value.length) return \"\";\n const { sign, value: positiveValue } = unsignedDecimal(value);\n return sign + Decimal.fromUserInput(positiveValue, PRECISION).atomics;\n },\n decode(value: string) {\n if (!value.length) return \"\";\n const { sign, value: positiveValue } = unsignedDecimal(value);\n return sign + Decimal.fromAtomics(positiveValue, PRECISION).toString();\n },\n} as const satisfies CustomType<string, string>;\n\n// cosmjs Decimal supports only non-negative decimals: https://github.com/cosmos/cosmjs/issues/1897\nfunction unsignedDecimal(value: string) {\n if (value[0] !== \"-\") return { sign: \"\", value };\n const positiveValue = value.slice(1);\n return { sign: \"-\", value: positiveValue };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAOxB,MAAM,YAAY;AAEX,MAAM,YAAY;AAAA,EACvB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO,OAAe;AACpB,QAAI,CAAC,MAAM,OAAQ,QAAO;AAC1B,UAAM,EAAE,MAAM,OAAO,cAAc,IAAI,gBAAgB,KAAK;AAC5D,WAAO,OAAO,oBAAQ,cAAc,eAAe,SAAS,EAAE;AAAA,EAChE;AAAA,EACA,OAAO,OAAe;AACpB,QAAI,CAAC,MAAM,OAAQ,QAAO;AAC1B,UAAM,EAAE,MAAM,OAAO,cAAc,IAAI,gBAAgB,KAAK;AAC5D,WAAO,OAAO,oBAAQ,YAAY,eAAe,SAAS,EAAE,SAAS;AAAA,EACvE;AACF;AAGA,SAAS,gBAAgB,OAAe;AACtC,MAAI,MAAM,CAAC,MAAM,IAAK,QAAO,EAAE,MAAM,IAAI,MAAM;AAC/C,QAAM,gBAAgB,MAAM,MAAM,CAAC;AACnC,SAAO,EAAE,MAAM,KAAK,OAAO,cAAc;AAC3C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
patches
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PJXRRT4L.js";
|
|
4
4
|
|
|
5
5
|
// src/generated/protos/nodePatchMessage.ts
|
|
6
6
|
var patched = (messageDesc) => {
|
|
@@ -20,4 +20,4 @@ var patched = (messageDesc) => {
|
|
|
20
20
|
export {
|
|
21
21
|
patched
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-CIAGNQVY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LegacyDec
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WEZWIYX4.js";
|
|
4
4
|
|
|
5
5
|
// src/generated/patches/nodeCustomTypePatches.ts
|
|
6
6
|
var p = {
|
|
@@ -212,4 +212,4 @@ var patches = p;
|
|
|
212
212
|
export {
|
|
213
213
|
patches
|
|
214
214
|
};
|
|
215
|
-
//# sourceMappingURL=chunk-
|
|
215
|
+
//# sourceMappingURL=chunk-PJXRRT4L.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LegacyDec
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WEZWIYX4.js";
|
|
4
4
|
|
|
5
5
|
// src/encoding/binaryEncoding.ts
|
|
6
6
|
var decoder = new TextDecoder("utf-8");
|
|
@@ -510,4 +510,4 @@ var patches = p;
|
|
|
510
510
|
export {
|
|
511
511
|
patches
|
|
512
512
|
};
|
|
513
|
-
//# sourceMappingURL=chunk-
|
|
513
|
+
//# sourceMappingURL=chunk-TRASWQID.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/encoding/customTypes/LegacyDec.ts
|
|
2
|
+
import { Decimal } from "@cosmjs/math";
|
|
3
|
+
var PRECISION = 18;
|
|
4
|
+
var LegacyDec = {
|
|
5
|
+
typeName: "cosmossdk.io/math.LegacyDec",
|
|
6
|
+
shortName: "LegacyDec",
|
|
7
|
+
encode(value) {
|
|
8
|
+
if (!value.length) return "";
|
|
9
|
+
const { sign, value: positiveValue } = unsignedDecimal(value);
|
|
10
|
+
return sign + Decimal.fromUserInput(positiveValue, PRECISION).atomics;
|
|
11
|
+
},
|
|
12
|
+
decode(value) {
|
|
13
|
+
if (!value.length) return "";
|
|
14
|
+
const { sign, value: positiveValue } = unsignedDecimal(value);
|
|
15
|
+
return sign + Decimal.fromAtomics(positiveValue, PRECISION).toString();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function unsignedDecimal(value) {
|
|
19
|
+
if (value[0] !== "-") return { sign: "", value };
|
|
20
|
+
const positiveValue = value.slice(1);
|
|
21
|
+
return { sign: "-", value: positiveValue };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
LegacyDec
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=chunk-WEZWIYX4.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/encoding/customTypes/LegacyDec.ts"],
|
|
4
|
+
"sourcesContent": ["import { Decimal } from \"@cosmjs/math\";\n\nimport type { CustomType } from \"./CustomType.ts\";\n\n/**\n * @see https://github.com/cosmos/cosmos-sdk/blob/25b14c3caa2ecdc99840dbb88fdb3a2d8ac02158/math/dec.go#L21\n */\nconst PRECISION = 18;\n\nexport const LegacyDec = {\n typeName: \"cosmossdk.io/math.LegacyDec\",\n shortName: \"LegacyDec\",\n encode(value: string) {\n if (!value.length) return \"\";\n const { sign, value: positiveValue } = unsignedDecimal(value);\n return sign + Decimal.fromUserInput(positiveValue, PRECISION).atomics;\n },\n decode(value: string) {\n if (!value.length) return \"\";\n const { sign, value: positiveValue } = unsignedDecimal(value);\n return sign + Decimal.fromAtomics(positiveValue, PRECISION).toString();\n },\n} as const satisfies CustomType<string, string>;\n\n// cosmjs Decimal supports only non-negative decimals: https://github.com/cosmos/cosmjs/issues/1897\nfunction unsignedDecimal(value: string) {\n if (value[0] !== \"-\") return { sign: \"\", value };\n const positiveValue = value.slice(1);\n return { sign: \"-\", value: positiveValue };\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAOxB,IAAM,YAAY;AAEX,IAAM,YAAY;AAAA,EACvB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO,OAAe;AACpB,QAAI,CAAC,MAAM,OAAQ,QAAO;AAC1B,UAAM,EAAE,MAAM,OAAO,cAAc,IAAI,gBAAgB,KAAK;AAC5D,WAAO,OAAO,QAAQ,cAAc,eAAe,SAAS,EAAE;AAAA,EAChE;AAAA,EACA,OAAO,OAAe;AACpB,QAAI,CAAC,MAAM,OAAQ,QAAO;AAC1B,UAAM,EAAE,MAAM,OAAO,cAAc,IAAI,gBAAgB,KAAK;AAC5D,WAAO,OAAO,QAAQ,YAAY,eAAe,SAAS,EAAE,SAAS;AAAA,EACvE;AACF;AAGA,SAAS,gBAAgB,OAAe;AACtC,MAAI,MAAM,CAAC,MAAM,IAAK,QAAO,EAAE,MAAM,IAAI,MAAM;AAC/C,QAAM,gBAAgB,MAAM,MAAM,CAAC;AACnC,SAAO,EAAE,MAAM,KAAK,OAAO,cAAc;AAC3C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
patches
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TRASWQID.js";
|
|
4
4
|
|
|
5
5
|
// src/generated/protos/cosmosPatchMessage.ts
|
|
6
6
|
var patched = (messageDesc) => {
|
|
@@ -20,4 +20,4 @@ var patched = (messageDesc) => {
|
|
|
20
20
|
export {
|
|
21
21
|
patched
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-YY3I7UCT.js.map
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
} from "../../chunk-ZQPE2HO5.js";
|
|
82
82
|
import {
|
|
83
83
|
patched
|
|
84
|
-
} from "../../chunk-
|
|
84
|
+
} from "../../chunk-CIAGNQVY.js";
|
|
85
85
|
import {
|
|
86
86
|
Account as Account2,
|
|
87
87
|
AccountState,
|
|
@@ -104,8 +104,8 @@ import {
|
|
|
104
104
|
PlacementRequirements,
|
|
105
105
|
SignedBy
|
|
106
106
|
} from "../../chunk-CBIGKRIC.js";
|
|
107
|
-
import "../../chunk-
|
|
108
|
-
import "../../chunk-
|
|
107
|
+
import "../../chunk-PJXRRT4L.js";
|
|
108
|
+
import "../../chunk-WEZWIYX4.js";
|
|
109
109
|
import {
|
|
110
110
|
Coin,
|
|
111
111
|
DecCoin
|
|
@@ -68,14 +68,14 @@ import {
|
|
|
68
68
|
} from "../../chunk-WEQ7JS3Q.js";
|
|
69
69
|
import {
|
|
70
70
|
patched
|
|
71
|
-
} from "../../chunk-
|
|
71
|
+
} from "../../chunk-CIAGNQVY.js";
|
|
72
72
|
import "../../chunk-LKONGR6G.js";
|
|
73
73
|
import "../../chunk-KRVUULER.js";
|
|
74
74
|
import "../../chunk-SFE3CJOZ.js";
|
|
75
75
|
import "../../chunk-EQ5P6XEC.js";
|
|
76
76
|
import "../../chunk-CBIGKRIC.js";
|
|
77
|
-
import "../../chunk-
|
|
78
|
-
import "../../chunk-
|
|
77
|
+
import "../../chunk-PJXRRT4L.js";
|
|
78
|
+
import "../../chunk-WEZWIYX4.js";
|
|
79
79
|
import "../../chunk-CZDD2R4Y.js";
|
|
80
80
|
import {
|
|
81
81
|
isSet
|
|
@@ -48,14 +48,14 @@ import "../../chunk-X4X3XXIX.js";
|
|
|
48
48
|
import "../../chunk-WEQ7JS3Q.js";
|
|
49
49
|
import {
|
|
50
50
|
patched
|
|
51
|
-
} from "../../chunk-
|
|
51
|
+
} from "../../chunk-CIAGNQVY.js";
|
|
52
52
|
import "../../chunk-LKONGR6G.js";
|
|
53
53
|
import "../../chunk-KRVUULER.js";
|
|
54
54
|
import "../../chunk-SFE3CJOZ.js";
|
|
55
55
|
import "../../chunk-EQ5P6XEC.js";
|
|
56
56
|
import "../../chunk-CBIGKRIC.js";
|
|
57
|
-
import "../../chunk-
|
|
58
|
-
import "../../chunk-
|
|
57
|
+
import "../../chunk-PJXRRT4L.js";
|
|
58
|
+
import "../../chunk-WEZWIYX4.js";
|
|
59
59
|
import "../../chunk-CZDD2R4Y.js";
|
|
60
60
|
import {
|
|
61
61
|
isSet
|
|
@@ -212,10 +212,10 @@ import {
|
|
|
212
212
|
} from "../../chunk-DSAPR3SJ.js";
|
|
213
213
|
import {
|
|
214
214
|
patched
|
|
215
|
-
} from "../../chunk-
|
|
216
|
-
import "../../chunk-
|
|
215
|
+
} from "../../chunk-YY3I7UCT.js";
|
|
216
|
+
import "../../chunk-TRASWQID.js";
|
|
217
217
|
import "../../chunk-EQ5P6XEC.js";
|
|
218
|
-
import "../../chunk-
|
|
218
|
+
import "../../chunk-WEZWIYX4.js";
|
|
219
219
|
import "../../chunk-CZDD2R4Y.js";
|
|
220
220
|
import "../../chunk-XKZOJLXG.js";
|
|
221
221
|
import {
|
|
@@ -485,7 +485,7 @@ import {
|
|
|
485
485
|
} from "../../chunk-HZ2RYI6M.js";
|
|
486
486
|
import {
|
|
487
487
|
patched
|
|
488
|
-
} from "../../chunk-
|
|
488
|
+
} from "../../chunk-YY3I7UCT.js";
|
|
489
489
|
import {
|
|
490
490
|
AuthInfo,
|
|
491
491
|
AuxSignerData,
|
|
@@ -509,12 +509,12 @@ import {
|
|
|
509
509
|
TxBody,
|
|
510
510
|
TxRaw
|
|
511
511
|
} from "../../chunk-QEFUYFBR.js";
|
|
512
|
-
import "../../chunk-
|
|
512
|
+
import "../../chunk-TRASWQID.js";
|
|
513
513
|
import {
|
|
514
514
|
PageRequest,
|
|
515
515
|
PageResponse
|
|
516
516
|
} from "../../chunk-EQ5P6XEC.js";
|
|
517
|
-
import "../../chunk-
|
|
517
|
+
import "../../chunk-WEZWIYX4.js";
|
|
518
518
|
import {
|
|
519
519
|
Coin,
|
|
520
520
|
DecCoin,
|
package/dist/esm/index.js
CHANGED
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
import "./chunk-QEFUYFBR.js";
|
|
31
31
|
import {
|
|
32
32
|
patches
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-TRASWQID.js";
|
|
34
34
|
import {
|
|
35
35
|
patches as patches2
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-PJXRRT4L.js";
|
|
37
|
+
import "./chunk-WEZWIYX4.js";
|
|
38
38
|
import "./chunk-CZDD2R4Y.js";
|
|
39
39
|
import "./chunk-VXN2QBXS.js";
|
|
40
40
|
import "./chunk-I4MPDVML.js";
|
package/dist/esm/index.web.js
CHANGED
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
import "./chunk-QEFUYFBR.js";
|
|
25
25
|
import {
|
|
26
26
|
patches
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TRASWQID.js";
|
|
28
28
|
import {
|
|
29
29
|
patches as patches2
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-PJXRRT4L.js";
|
|
31
|
+
import "./chunk-WEZWIYX4.js";
|
|
32
32
|
import "./chunk-CZDD2R4Y.js";
|
|
33
33
|
import "./chunk-VXN2QBXS.js";
|
|
34
34
|
import "./chunk-I4MPDVML.js";
|