@gitopia/gitopiajs 0.0.5 → 0.0.6
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/esm/helpers.js +4 -2
- package/dist/helpers.js +5 -3
- package/dist/package.json +4 -3
- package/package.json +4 -3
package/dist/esm/helpers.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
5
5
|
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
6
6
|
*/
|
|
7
|
+
// Buffer polyfill for browser compatibility
|
|
8
|
+
import { Buffer } from 'buffer';
|
|
7
9
|
var globalThis = (() => {
|
|
8
10
|
if (typeof globalThis !== 'undefined')
|
|
9
11
|
return globalThis;
|
|
@@ -16,7 +18,7 @@ var globalThis = (() => {
|
|
|
16
18
|
throw 'Unable to locate global object';
|
|
17
19
|
})();
|
|
18
20
|
const atob = globalThis.atob ||
|
|
19
|
-
((b64) =>
|
|
21
|
+
((b64) => Buffer.from(b64, 'base64').toString('binary'));
|
|
20
22
|
export function bytesFromBase64(b64) {
|
|
21
23
|
const bin = atob(b64);
|
|
22
24
|
const arr = new Uint8Array(bin.length);
|
|
@@ -26,7 +28,7 @@ export function bytesFromBase64(b64) {
|
|
|
26
28
|
return arr;
|
|
27
29
|
}
|
|
28
30
|
const btoa = globalThis.btoa ||
|
|
29
|
-
((bin) =>
|
|
31
|
+
((bin) => Buffer.from(bin, 'binary').toString('base64'));
|
|
30
32
|
export function base64FromBytes(arr) {
|
|
31
33
|
const bin = [];
|
|
32
34
|
arr.forEach((byte) => {
|
package/dist/helpers.js
CHANGED
|
@@ -18,6 +18,8 @@ exports.isRpc = isRpc;
|
|
|
18
18
|
exports.toTimestamp = toTimestamp;
|
|
19
19
|
exports.fromTimestamp = fromTimestamp;
|
|
20
20
|
exports.fromJsonTimestamp = fromJsonTimestamp;
|
|
21
|
+
// Buffer polyfill for browser compatibility
|
|
22
|
+
const buffer_1 = require("buffer");
|
|
21
23
|
var globalThis = (() => {
|
|
22
24
|
if (typeof globalThis !== 'undefined')
|
|
23
25
|
return globalThis;
|
|
@@ -30,7 +32,7 @@ var globalThis = (() => {
|
|
|
30
32
|
throw 'Unable to locate global object';
|
|
31
33
|
})();
|
|
32
34
|
const atob = globalThis.atob ||
|
|
33
|
-
((b64) =>
|
|
35
|
+
((b64) => buffer_1.Buffer.from(b64, 'base64').toString('binary'));
|
|
34
36
|
function bytesFromBase64(b64) {
|
|
35
37
|
const bin = atob(b64);
|
|
36
38
|
const arr = new Uint8Array(bin.length);
|
|
@@ -40,7 +42,7 @@ function bytesFromBase64(b64) {
|
|
|
40
42
|
return arr;
|
|
41
43
|
}
|
|
42
44
|
const btoa = globalThis.btoa ||
|
|
43
|
-
((bin) =>
|
|
45
|
+
((bin) => buffer_1.Buffer.from(bin, 'binary').toString('base64'));
|
|
44
46
|
function base64FromBytes(arr) {
|
|
45
47
|
const bin = [];
|
|
46
48
|
arr.forEach((byte) => {
|
|
@@ -90,7 +92,7 @@ const setPaginationParams = (options, pagination) => {
|
|
|
90
92
|
// String to Uint8Array
|
|
91
93
|
// let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
|
|
92
94
|
// Uint8Array to String
|
|
93
|
-
options.params['pagination.key'] = Buffer.from(pagination.key).toString('base64');
|
|
95
|
+
options.params['pagination.key'] = buffer_1.Buffer.from(pagination.key).toString('base64');
|
|
94
96
|
}
|
|
95
97
|
if (typeof pagination?.limit !== 'undefined') {
|
|
96
98
|
options.params['pagination.limit'] = pagination.limit.toString();
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitopia/gitopiajs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"author": "Faza Mahamood <faza@gitopia.org>",
|
|
5
5
|
"description": "js client library for gitopia protocol",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
"@cosmjs/math": "0.32.4",
|
|
42
42
|
"@cosmjs/proto-signing": "0.32.4",
|
|
43
43
|
"@cosmjs/stargate": "0.32.4",
|
|
44
|
-
"@cosmology/lcd": "^0.14.0"
|
|
44
|
+
"@cosmology/lcd": "^0.14.0",
|
|
45
|
+
"buffer": "^6.0.3"
|
|
45
46
|
},
|
|
46
47
|
"keywords": [],
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3d85133277080ff9450911a37668dd7fd7143c5c"
|
|
48
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitopia/gitopiajs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"author": "Faza Mahamood <faza@gitopia.org>",
|
|
5
5
|
"description": "js client library for gitopia protocol",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
"@cosmjs/math": "0.32.4",
|
|
42
42
|
"@cosmjs/proto-signing": "0.32.4",
|
|
43
43
|
"@cosmjs/stargate": "0.32.4",
|
|
44
|
-
"@cosmology/lcd": "^0.14.0"
|
|
44
|
+
"@cosmology/lcd": "^0.14.0",
|
|
45
|
+
"buffer": "^6.0.3"
|
|
45
46
|
},
|
|
46
47
|
"keywords": [],
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3d85133277080ff9450911a37668dd7fd7143c5c"
|
|
48
49
|
}
|