coreum-js 2.8.21 → 2.8.23
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/main/utils/convertStringToAny.d.ts +1 -0
- package/dist/main/utils/convertStringToAny.js +15 -0
- package/dist/main/utils/index.d.ts +1 -0
- package/dist/main/utils/index.js +1 -0
- package/dist/module/utils/convertStringToAny.d.ts +1 -0
- package/dist/module/utils/convertStringToAny.js +11 -0
- package/dist/module/utils/index.d.ts +1 -0
- package/dist/module/utils/index.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertStringToAny: (message: string) => Any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertStringToAny = void 0;
|
|
4
|
+
const any_pb_1 = require("google-protobuf/google/protobuf/any_pb");
|
|
5
|
+
const types_1 = require("../coreum/asset/nft/v1/types");
|
|
6
|
+
const convertStringToAny = (message) => {
|
|
7
|
+
const formattedValueOfData = btoa(message);
|
|
8
|
+
const dataBytesMessage = types_1.DataBytes.fromJSON({ Data: formattedValueOfData });
|
|
9
|
+
const dataBytesBinary = types_1.DataBytes.encode(dataBytesMessage).finish();
|
|
10
|
+
const formattedAnyDataValue = new any_pb_1.Any();
|
|
11
|
+
formattedAnyDataValue.typeUrl = '/coreum.asset.nft.v1.DataBytes';
|
|
12
|
+
formattedAnyDataValue.value = dataBytesBinary;
|
|
13
|
+
return formattedAnyDataValue;
|
|
14
|
+
};
|
|
15
|
+
exports.convertStringToAny = convertStringToAny;
|
package/dist/main/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertStringToAny: (message: string) => Any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Any } from 'google-protobuf/google/protobuf/any_pb';
|
|
2
|
+
import { DataBytes } from '../coreum/asset/nft/v1/types';
|
|
3
|
+
export const convertStringToAny = (message) => {
|
|
4
|
+
const formattedValueOfData = btoa(message);
|
|
5
|
+
const dataBytesMessage = DataBytes.fromJSON({ Data: formattedValueOfData });
|
|
6
|
+
const dataBytesBinary = DataBytes.encode(dataBytesMessage).finish();
|
|
7
|
+
const formattedAnyDataValue = new Any();
|
|
8
|
+
formattedAnyDataValue.typeUrl = '/coreum.asset.nft.v1.DataBytes';
|
|
9
|
+
formattedAnyDataValue.value = dataBytesBinary;
|
|
10
|
+
return formattedAnyDataValue;
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coreum-js",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.23",
|
|
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",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"bech32": "^2.0.0",
|
|
34
34
|
"bignumber.js": "^9.1.1",
|
|
35
35
|
"eventemitter3": "^5.0.0",
|
|
36
|
+
"google-protobuf": "^3.21.2",
|
|
36
37
|
"ws": "^8.13.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|