From c5c3f9431b0891d7be827c115de4056855f4a172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20=C5=BDivkovi=C4=87?= Date: Wed, 26 Jun 2024 15:42:03 +0200 Subject: [PATCH] feat: lowercase the field names for `MsgCall` (#132) * Lowercase the field names for MsgCall, update proto * Bump package.json version * Bump tm-js version --- package.json | 6 +++--- proto/gno/vm.proto | 12 +++++------- src/proto/gno/bank.ts | 6 ------ src/proto/gno/vm.ts | 32 +++++++++++++------------------- yarn.lock | 20 ++++++++++---------- 5 files changed, 31 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index dce0d8a..a71972b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gnolang/gno-js-client", - "version": "1.2.3", + "version": "1.3.0", "description": "Gno JS / TS Client", "main": "./bin/index.js", "author": "Milos Zivkovic ", @@ -48,8 +48,8 @@ "prepublishOnly": "yarn lint && yarn prettier" }, "dependencies": { - "@cosmjs/ledger-amino": "^0.32.0", - "@gnolang/tm2-js-client": "^1.2.0", + "@cosmjs/ledger-amino": "^0.32.4", + "@gnolang/tm2-js-client": "^1.2.1", "long": "^5.2.3", "protobufjs": "^7.2.3" } diff --git a/proto/gno/vm.proto b/proto/gno/vm.proto index 509b35b..2ccc37e 100644 --- a/proto/gno/vm.proto +++ b/proto/gno/vm.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package gno.vm; - - // MsgCall is the method invocation tx message, // denoted as "m_call" message MsgCall { @@ -45,18 +43,18 @@ message MsgRun { // package / realm deployment message MemPackage { // the name of the package - string name = 1 [json_name = "Name"]; + string name = 1; // the gno path of the package - string path = 2 [json_name = "Path"]; + string path = 2; // the associated package gno source - repeated MemFile files = 3 [json_name = "Files"]; + repeated MemFile files = 3; } // MemFile is the metadata information tied to // a single gno package / realm file message MemFile { // the name of the source gno file - string name = 1 [json_name = "Name"]; + string name = 1; // the content of the source gno file - string body = 2 [json_name = "Body"]; + string body = 2; } \ No newline at end of file diff --git a/src/proto/gno/bank.ts b/src/proto/gno/bank.ts index 7c03218..6e0ddeb 100644 --- a/src/proto/gno/bank.ts +++ b/src/proto/gno/bank.ts @@ -1,9 +1,3 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v1.180.0 -// protoc v5.27.1 -// source: gno/bank.proto - /* eslint-disable */ import Long from 'long'; import _m0 from 'protobufjs/minimal'; diff --git a/src/proto/gno/vm.ts b/src/proto/gno/vm.ts index 02421c3..8074fdb 100644 --- a/src/proto/gno/vm.ts +++ b/src/proto/gno/vm.ts @@ -1,9 +1,3 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v1.180.0 -// protoc v5.27.1 -// source: gno/vm.proto - /* eslint-disable */ import Long from 'long'; import _m0 from 'protobufjs/minimal'; @@ -280,12 +274,12 @@ export const MsgAddPackage = { }, toJSON(message: MsgAddPackage): unknown { - const obj = createBaseMsgAddPackage(); + const obj: any = {}; if (message.creator !== undefined) { obj.creator = message.creator; } if (message.package !== undefined) { - obj.package = MemPackage.toJSON(message.package) as MemPackage; + obj.package = MemPackage.toJSON(message.package); } if (message.deposit !== undefined) { obj.deposit = message.deposit; @@ -471,10 +465,10 @@ export const MemPackage = { fromJSON(object: any): MemPackage { return { - name: isSet(object.Name) ? globalThis.String(object.Name) : '', - path: isSet(object.Path) ? globalThis.String(object.Path) : '', - files: globalThis.Array.isArray(object?.Files) - ? object.Files.map((e: any) => MemFile.fromJSON(e)) + name: isSet(object.name) ? globalThis.String(object.name) : '', + path: isSet(object.path) ? globalThis.String(object.path) : '', + files: globalThis.Array.isArray(object?.files) + ? object.files.map((e: any) => MemFile.fromJSON(e)) : [], }; }, @@ -482,13 +476,13 @@ export const MemPackage = { toJSON(message: MemPackage): unknown { const obj: any = {}; if (message.name !== undefined) { - obj.Name = message.name; + obj.name = message.name; } if (message.path !== undefined) { - obj.Path = message.path; + obj.path = message.path; } if (message.files?.length) { - obj.Files = message.files.map((e) => MemFile.toJSON(e)); + obj.files = message.files.map((e) => MemFile.toJSON(e)); } return obj; }, @@ -558,18 +552,18 @@ export const MemFile = { fromJSON(object: any): MemFile { return { - name: isSet(object.Name) ? globalThis.String(object.Name) : '', - body: isSet(object.Body) ? globalThis.String(object.Body) : '', + name: isSet(object.name) ? globalThis.String(object.name) : '', + body: isSet(object.body) ? globalThis.String(object.body) : '', }; }, toJSON(message: MemFile): unknown { const obj: any = {}; if (message.name !== undefined) { - obj.Name = message.name; + obj.name = message.name; } if (message.body !== undefined) { - obj.Body = message.body; + obj.body = message.body; } return obj; }, diff --git a/yarn.lock b/yarn.lock index c56c5fc..013c066 100644 --- a/yarn.lock +++ b/yarn.lock @@ -308,7 +308,7 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cosmjs/amino@^0.32.0", "@cosmjs/amino@^0.32.4": +"@cosmjs/amino@^0.32.4": version "0.32.4" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.4.tgz#3908946c0394e6d431694c8992c5147079a1c860" integrity sha512-zKYOt6hPy8obIFtLie/xtygCkH9ZROiQ12UHfKsOkWaZfPQUvVbtgmu6R4Kn1tFLI/SRkw7eqhaogmW/3NYu/Q== @@ -318,7 +318,7 @@ "@cosmjs/math" "^0.32.4" "@cosmjs/utils" "^0.32.4" -"@cosmjs/crypto@^0.32.0", "@cosmjs/crypto@^0.32.4": +"@cosmjs/crypto@^0.32.4": version "0.32.4" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.4.tgz#5d29633b661eaf092ddb3e7ea6299cfd6f4507a2" integrity sha512-zicjGU051LF1V9v7bp8p7ovq+VyC91xlaHdsFOTo2oVry3KQikp8L/81RkXmUIT8FxMwdx1T7DmFwVQikcSDIw== @@ -340,7 +340,7 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/ledger-amino@^0.32.0": +"@cosmjs/ledger-amino@^0.32.4": version "0.32.4" resolved "https://registry.yarnpkg.com/@cosmjs/ledger-amino/-/ledger-amino-0.32.4.tgz#fa2fba0390b0e4fab73491fbc57bc9f3e77a1160" integrity sha512-Toys0CD/4pBfYDQmhQbmWualKJT98YVPpE8Ilkx1Rx0dcFtm57Mg7R4BgRFiL1sSoff5RWcDY6Chqp6zwAbrjA== @@ -397,14 +397,14 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== -"@gnolang/tm2-js-client@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@gnolang/tm2-js-client/-/tm2-js-client-1.2.0.tgz#cc8b4e038202cf2feaee688cef2888c9a983b01e" - integrity sha512-PjE2QT6tb1SGeY4lkT0MCh7S1aowJBj519NoaQWG9lK3VIYi4DbrVpuplg/e4RSb4b2g1Zo/6rWCtsLHdXT9Jg== +"@gnolang/tm2-js-client@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@gnolang/tm2-js-client/-/tm2-js-client-1.2.1.tgz#850b8e1f1d90226d5047c097f27fce25366c1dd8" + integrity sha512-zjQ5vFw7tyRJAyXdc9Z++x5Yp9qtWuHXhFBEAV0SkHcuBuKmv71Y4qo/0J3aVgHYnri4pc5YEmgX9KVeDgf9Og== dependencies: - "@cosmjs/amino" "^0.32.0" - "@cosmjs/crypto" "^0.32.0" - "@cosmjs/ledger-amino" "^0.32.0" + "@cosmjs/amino" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/ledger-amino" "^0.32.4" "@types/uuid" "^9.0.4" axios "^1.4.0" long "^5.2.3"