@initia/initia.js 0.0.11 → 0.0.12
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/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.node.js +1 -1
- package/dist/bundle.node.js.map +1 -1
- package/dist/util/address.d.ts +2 -0
- package/dist/util/address.js +16 -0
- package/dist/util/address.js.map +1 -0
- package/dist/util/bcs.d.ts +92 -11
- package/dist/util/bcs.js +142 -97
- package/dist/util/bcs.js.map +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hexToBech32 = exports.bech32ToHex = void 0;
|
|
7
|
+
var bech32_converting_1 = __importDefault(require("bech32-converting"));
|
|
8
|
+
function bech32ToHex(address) {
|
|
9
|
+
return (0, bech32_converting_1.default)('init').toHex(address);
|
|
10
|
+
}
|
|
11
|
+
exports.bech32ToHex = bech32ToHex;
|
|
12
|
+
function hexToBech32(address) {
|
|
13
|
+
return (0, bech32_converting_1.default)('init').toBech32(address);
|
|
14
|
+
}
|
|
15
|
+
exports.hexToBech32 = hexToBech32;
|
|
16
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/util/address.ts"],"names":[],"mappings":";;;;;;AAAA,wEAAwC;AAExC,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAO,IAAA,2BAAO,EAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAO,IAAA,2BAAO,EAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC;AAFD,kCAEC"}
|
package/dist/util/bcs.d.ts
CHANGED
|
@@ -1,12 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
static
|
|
1
|
+
import { StructTypeDefinition } from '@mysten/bcs';
|
|
2
|
+
export declare class BCS {
|
|
3
|
+
private mystenBcs;
|
|
4
|
+
static readonly U8: string;
|
|
5
|
+
static readonly U16: string;
|
|
6
|
+
static readonly U32: string;
|
|
7
|
+
static readonly U64: string;
|
|
8
|
+
static readonly U128: string;
|
|
9
|
+
static readonly U256: string;
|
|
10
|
+
static readonly BOOL: string;
|
|
11
|
+
static readonly VECTOR: string;
|
|
12
|
+
static readonly ADDRESS: string;
|
|
13
|
+
static readonly STRING: string;
|
|
14
|
+
static readonly OPTION: string;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Serialize data to bcs.
|
|
18
|
+
* Return base64 encoded string
|
|
19
|
+
*
|
|
20
|
+
* Preregistered types : `u8`, `u16`, `u32`, `u64`, `u128`, `u256`,
|
|
21
|
+
* `bool`, `vector`, `address`, `string`, `option`
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const bcs = new BCS();
|
|
25
|
+
*
|
|
26
|
+
* const num = bcs.serialize(BCS.U64, 2187462); // numeric
|
|
27
|
+
* const bool = bcs.serialize(BCS.BOOL, true); // bool
|
|
28
|
+
* const vector = bcs.serialize('vector<u64>', [1, 2, 3, 4]); // vector
|
|
29
|
+
* const string = bcs.serialize(BCS.STRING, 'initia'); // string
|
|
30
|
+
* const optionSome = bcs.serialize('option<u64>', 18237); // option some
|
|
31
|
+
* const optionNone = bcs.serialize('option<u64>', null); // option none
|
|
32
|
+
*
|
|
33
|
+
* @param type Name of the type of serialize
|
|
34
|
+
* @param data Data to serialize
|
|
35
|
+
* @param size Serialization buffer size. Default 1024 bytes
|
|
36
|
+
* @return Base64 encoded of serialized data
|
|
37
|
+
*/
|
|
38
|
+
serialize(type: string, data: any, size?: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* Deserialize bcs.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
*
|
|
44
|
+
* const bcs = new BCS();
|
|
45
|
+
*
|
|
46
|
+
* const num = bcs.serialize(BCS.U64, 2187462);
|
|
47
|
+
* const deNum = bcs.deserialize(BCS.U64, 2187462);
|
|
48
|
+
*
|
|
49
|
+
* @param type Name of the type of deserialize
|
|
50
|
+
* @param data Data to deserialize
|
|
51
|
+
* @param encoding Encoding to use if data is of type String. Default 'base64'
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
deserialize<T>(type: string, data: Uint8Array | string, encoding?: string): T;
|
|
55
|
+
/**
|
|
56
|
+
* Safe method to register a custom Move struct. The first argument is a name of the
|
|
57
|
+
* struct which is only used on the FrontEnd and has no affect on serialization results,
|
|
58
|
+
* and the second is a struct description passed as an Object.
|
|
59
|
+
*
|
|
60
|
+
* The description object MUST have the same order on all of the platforms (ie in Move
|
|
61
|
+
* or in Rust).
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Move struct
|
|
65
|
+
* // struct Data {
|
|
66
|
+
* // num: u64,
|
|
67
|
+
* // str: std::string::String,
|
|
68
|
+
* // vec: vector<bool>,
|
|
69
|
+
* // }
|
|
70
|
+
*
|
|
71
|
+
* const bcs = new BCS();
|
|
72
|
+
*
|
|
73
|
+
* bcs.registerStruct('data', {
|
|
74
|
+
* num: BCS.U64,
|
|
75
|
+
* str: BCS.STRING,
|
|
76
|
+
* vec: 'vector<bool>'
|
|
77
|
+
* });
|
|
78
|
+
*
|
|
79
|
+
* const data = {
|
|
80
|
+
* num: 1234,
|
|
81
|
+
* str: '1234',
|
|
82
|
+
* vec: [true, false, true],
|
|
83
|
+
* };
|
|
84
|
+
*
|
|
85
|
+
* const ser = bcs.serialize('data', data);
|
|
86
|
+
* const de = bcs.deserialize('data', ser);
|
|
87
|
+
*
|
|
88
|
+
* @param name Name of the type to register.
|
|
89
|
+
* @param fields Fields of the struct. Must be in the correct order.
|
|
90
|
+
*/
|
|
91
|
+
registerStruct(name: string, fields: StructTypeDefinition): void;
|
|
92
|
+
private registerOptionType;
|
|
12
93
|
}
|
package/dist/util/bcs.js
CHANGED
|
@@ -1,103 +1,148 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
var bech32_converting_1 = __importDefault(require("bech32-converting"));
|
|
3
|
+
exports.BCS = void 0;
|
|
23
4
|
var bcs_1 = require("@mysten/bcs");
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function serializeString(data) {
|
|
34
|
-
return serialize(ExtendedBcs.STRING, data);
|
|
35
|
-
}
|
|
36
|
-
exports.serializeString = serializeString;
|
|
37
|
-
function serializeAddress(data) {
|
|
38
|
-
if (!ExtendedBcs.hasType(ExtendedBcs.ADDRESS)) {
|
|
39
|
-
ExtendedBcs.registerAddressType(ExtendedBcs.ADDRESS, 20, 'hex');
|
|
40
|
-
}
|
|
41
|
-
var converted = (0, bech32_converting_1.default)('init').toHex(data);
|
|
42
|
-
return serialize(ExtendedBcs.ADDRESS, converted);
|
|
43
|
-
}
|
|
44
|
-
exports.serializeAddress = serializeAddress;
|
|
45
|
-
function serializeVector(type, data) {
|
|
46
|
-
if (!ExtendedBcs.hasType(type)) {
|
|
47
|
-
throw Error("Must register type ".concat(type, " first"));
|
|
48
|
-
}
|
|
49
|
-
var vectorType = "vector<".concat(type, ">");
|
|
50
|
-
if (!ExtendedBcs.hasType(vectorType)) {
|
|
51
|
-
ExtendedBcs.registerVectorType(vectorType, type);
|
|
52
|
-
}
|
|
53
|
-
return serialize(vectorType, data);
|
|
54
|
-
}
|
|
55
|
-
exports.serializeVector = serializeVector;
|
|
56
|
-
function serializeOption(type, data) {
|
|
57
|
-
if (!ExtendedBcs.hasType(type)) {
|
|
58
|
-
throw Error("Must register type ".concat(type, " first"));
|
|
59
|
-
}
|
|
60
|
-
var optionType = "option<".concat(type, ">");
|
|
61
|
-
if (!ExtendedBcs.hasType(optionType)) {
|
|
62
|
-
ExtendedBcs.registerOptionType(optionType, type);
|
|
63
|
-
}
|
|
64
|
-
return serialize(optionType, data);
|
|
65
|
-
}
|
|
66
|
-
exports.serializeOption = serializeOption;
|
|
67
|
-
function serialize(type, data) {
|
|
68
|
-
return ExtendedBcs.ser(type, data).toString('base64');
|
|
69
|
-
}
|
|
70
|
-
exports.serialize = serialize;
|
|
71
|
-
var ExtendedBcs = /** @class */ (function (_super) {
|
|
72
|
-
__extends(ExtendedBcs, _super);
|
|
73
|
-
function ExtendedBcs() {
|
|
74
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
5
|
+
var BCS = /** @class */ (function () {
|
|
6
|
+
function BCS() {
|
|
7
|
+
this.mystenBcs = new bcs_1.BCS({
|
|
8
|
+
genericSeparators: ['<', '>'],
|
|
9
|
+
vectorType: 'vector',
|
|
10
|
+
addressLength: 20,
|
|
11
|
+
addressEncoding: 'hex',
|
|
12
|
+
});
|
|
13
|
+
this.registerOptionType(BCS.OPTION);
|
|
75
14
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Serialize data to bcs.
|
|
17
|
+
* Return base64 encoded string
|
|
18
|
+
*
|
|
19
|
+
* Preregistered types : `u8`, `u16`, `u32`, `u64`, `u128`, `u256`,
|
|
20
|
+
* `bool`, `vector`, `address`, `string`, `option`
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const bcs = new BCS();
|
|
24
|
+
*
|
|
25
|
+
* const num = bcs.serialize(BCS.U64, 2187462); // numeric
|
|
26
|
+
* const bool = bcs.serialize(BCS.BOOL, true); // bool
|
|
27
|
+
* const vector = bcs.serialize('vector<u64>', [1, 2, 3, 4]); // vector
|
|
28
|
+
* const string = bcs.serialize(BCS.STRING, 'initia'); // string
|
|
29
|
+
* const optionSome = bcs.serialize('option<u64>', 18237); // option some
|
|
30
|
+
* const optionNone = bcs.serialize('option<u64>', null); // option none
|
|
31
|
+
*
|
|
32
|
+
* @param type Name of the type of serialize
|
|
33
|
+
* @param data Data to serialize
|
|
34
|
+
* @param size Serialization buffer size. Default 1024 bytes
|
|
35
|
+
* @return Base64 encoded of serialized data
|
|
36
|
+
*/
|
|
37
|
+
BCS.prototype.serialize = function (type, data, size) {
|
|
38
|
+
if (size === void 0) { size = 1024; }
|
|
39
|
+
return this.mystenBcs.ser(type, data, size).toString('base64');
|
|
82
40
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Deserialize bcs.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
*
|
|
46
|
+
* const bcs = new BCS();
|
|
47
|
+
*
|
|
48
|
+
* const num = bcs.serialize(BCS.U64, 2187462);
|
|
49
|
+
* const deNum = bcs.deserialize(BCS.U64, 2187462);
|
|
50
|
+
*
|
|
51
|
+
* @param type Name of the type of deserialize
|
|
52
|
+
* @param data Data to deserialize
|
|
53
|
+
* @param encoding Encoding to use if data is of type String. Default 'base64'
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
BCS.prototype.deserialize = function (type, data, encoding) {
|
|
57
|
+
if (encoding === void 0) { encoding = 'base64'; }
|
|
58
|
+
return this.mystenBcs.de(type, data, encoding);
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Safe method to register a custom Move struct. The first argument is a name of the
|
|
62
|
+
* struct which is only used on the FrontEnd and has no affect on serialization results,
|
|
63
|
+
* and the second is a struct description passed as an Object.
|
|
64
|
+
*
|
|
65
|
+
* The description object MUST have the same order on all of the platforms (ie in Move
|
|
66
|
+
* or in Rust).
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // Move struct
|
|
70
|
+
* // struct Data {
|
|
71
|
+
* // num: u64,
|
|
72
|
+
* // str: std::string::String,
|
|
73
|
+
* // vec: vector<bool>,
|
|
74
|
+
* // }
|
|
75
|
+
*
|
|
76
|
+
* const bcs = new BCS();
|
|
77
|
+
*
|
|
78
|
+
* bcs.registerStruct('data', {
|
|
79
|
+
* num: BCS.U64,
|
|
80
|
+
* str: BCS.STRING,
|
|
81
|
+
* vec: 'vector<bool>'
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* const data = {
|
|
85
|
+
* num: 1234,
|
|
86
|
+
* str: '1234',
|
|
87
|
+
* vec: [true, false, true],
|
|
88
|
+
* };
|
|
89
|
+
*
|
|
90
|
+
* const ser = bcs.serialize('data', data);
|
|
91
|
+
* const de = bcs.deserialize('data', ser);
|
|
92
|
+
*
|
|
93
|
+
* @param name Name of the type to register.
|
|
94
|
+
* @param fields Fields of the struct. Must be in the correct order.
|
|
95
|
+
*/
|
|
96
|
+
BCS.prototype.registerStruct = function (name, fields) {
|
|
97
|
+
this.mystenBcs.registerStructType(name, fields);
|
|
98
|
+
};
|
|
99
|
+
BCS.prototype.registerOptionType = function (name, elementType) {
|
|
100
|
+
var _this = this;
|
|
101
|
+
var _a = this.mystenBcs.parseTypeName(name), typeName = _a.typeName, typeParams = _a.typeParams;
|
|
102
|
+
if (typeParams.length > 1) {
|
|
103
|
+
throw new Error('Option can have only one type parameter; got ' + name);
|
|
104
|
+
}
|
|
105
|
+
return this.mystenBcs.registerType(typeName, function (writer, data, typeParams) {
|
|
106
|
+
return writer.writeVec(data === null ? [] : [data], function (writer, el) {
|
|
107
|
+
var vectorType = elementType || typeParams[0];
|
|
108
|
+
if (!!vectorType) {
|
|
109
|
+
var _a = _this.mystenBcs.parseTypeName(vectorType), typeName_1 = _a.typeName, typeParams_1 = _a.typeParams;
|
|
110
|
+
return _this.mystenBcs
|
|
111
|
+
.getTypeInterface(elementType || typeName_1)
|
|
112
|
+
._encodeRaw(writer, el, typeParams_1);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
throw new Error("Incorrect number of type parameters passed to option '".concat(typeName, "'"));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}, function (reader, typeParams) {
|
|
119
|
+
var vec = reader.readVec(function (reader) {
|
|
120
|
+
var vectorType = elementType || typeParams[0];
|
|
121
|
+
if (!!vectorType) {
|
|
122
|
+
var _a = _this.mystenBcs.parseTypeName(vectorType), typeName_2 = _a.typeName, typeParams_2 = _a.typeParams;
|
|
123
|
+
return _this.mystenBcs
|
|
124
|
+
.getTypeInterface(elementType || typeName_2)
|
|
125
|
+
._decodeRaw(reader, typeParams_2);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
throw new Error("Incorrect number of type parameters passed to option '".concat(typeName, "'"));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return vec[0] ? vec[0] : null;
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
BCS.U8 = 'u8';
|
|
135
|
+
BCS.U16 = 'u16';
|
|
136
|
+
BCS.U32 = 'u32';
|
|
137
|
+
BCS.U64 = 'u64';
|
|
138
|
+
BCS.U128 = 'u128';
|
|
139
|
+
BCS.U256 = 'u256';
|
|
140
|
+
BCS.BOOL = 'bool';
|
|
141
|
+
BCS.VECTOR = 'vector';
|
|
142
|
+
BCS.ADDRESS = 'address';
|
|
143
|
+
BCS.STRING = 'string';
|
|
144
|
+
BCS.OPTION = 'option';
|
|
145
|
+
return BCS;
|
|
146
|
+
}());
|
|
147
|
+
exports.BCS = BCS;
|
|
103
148
|
//# sourceMappingURL=bcs.js.map
|
package/dist/util/bcs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcs.js","sourceRoot":"","sources":["../../src/util/bcs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bcs.js","sourceRoot":"","sources":["../../src/util/bcs.ts"],"names":[],"mappings":";;;AAAA,mCAKqB;AAErB;IAeE;QACE,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;YAC7B,iBAAiB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;YAC7B,UAAU,EAAE,QAAQ;YACpB,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,KAAK;SACvB,C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,CAAC;IAClB,OAAG,GAAW,KAAK,CAAC;IACpB,OAAG,GAAW,KAAK,CAAC;IACpB,OAAG,GAAW,KAAK,CAAC;IACpB,QAAI,GAAW,MAAM,CAAC;IACtB,QAAI,GAAW,MAAM,CAAC;IACtB,QAAI,GAAW,MAAM,CAAC;IACtB,UAAM,GAAW,QAAQ,CAAC;IAC1B,WAAO,GAAW,SAAS,CAAC;IAC5B,UAAM,GAAW,QAAQ,CAAC;IAC1B,UAAM,GAAW,QAAQ,CAAC;IAkJ5C,UAAC;CAAA,AA/JD,IA+JC;AA/JY,kBAAG"}
|
package/dist/util/index.d.ts
CHANGED
package/dist/util/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./address"), exports);
|
|
17
18
|
__exportStar(require("./hash"), exports);
|
|
18
19
|
__exportStar(require("./contract"), exports);
|
|
19
20
|
__exportStar(require("./bcs"), exports);
|
package/dist/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,6CAA2B;AAC3B,wCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB;AACvB,6CAA2B;AAC3B,wCAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@initia/initia.js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "The JavaScript SDK for Initia",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "InitiaLabs",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@initia/initia.proto": "^0.0.3-alpha1",
|
|
86
|
-
"@mysten/bcs": "^0.
|
|
86
|
+
"@mysten/bcs": "^0.5.0",
|
|
87
87
|
"axios": "^0.27.2",
|
|
88
88
|
"bech32": "^2.0.0",
|
|
89
89
|
"bech32-converting": "^1.0.9",
|