forked from cerc-io/laconic-sdk
Compare commits
8 Commits
roy/rm-har
...
main
Author | SHA1 | Date | |
---|---|---|---|
990e427c3f | |||
419dddc35a | |||
99bc3f0ce5 | |||
fc2987a5ca | |||
aba95a275c | |||
a3603e2738 | |||
27443c3cac | |||
b5fce86d48 |
@ -7,12 +7,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [ 16.x ]
|
node-version: [ 18.x ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Download yarn
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o /usr/local/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.21/yarn-1.22.21.js
|
||||||
|
chmod +x /usr/local/bin/yarn
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@ -26,7 +30,7 @@ jobs:
|
|||||||
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
|
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
|
||||||
- name: Authenticate to git.vdb.to registry
|
- name: Authenticate to git.vdb.to registry
|
||||||
run: |
|
run: |
|
||||||
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}"
|
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.CICD_PUBLISH_TOKEN }}"
|
||||||
- name: npm publish
|
- name: npm publish
|
||||||
run: |
|
run: |
|
||||||
npm publish
|
npm publish
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cerc-io/laconic-sdk",
|
"name": "@cerc-io/laconic-sdk",
|
||||||
"version": "0.1.6",
|
"version": "0.1.13",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"repository": "git@github.com:cerc-io/laconic-sdk.git",
|
"repository": "git@github.com:cerc-io/laconic-sdk.git",
|
||||||
@ -14,7 +14,7 @@
|
|||||||
"dotenv": "^16.0.0",
|
"dotenv": "^16.0.0",
|
||||||
"google-protobuf": "^3.21.0",
|
"google-protobuf": "^3.21.0",
|
||||||
"jest": "29.0.0",
|
"jest": "29.0.0",
|
||||||
"protoc-gen-ts": "^0.8.5",
|
"protoc-gen-ts": "^0.8.7",
|
||||||
"ts-jest": "^29.0.2",
|
"ts-jest": "^29.0.2",
|
||||||
"typescript": "^4.6.2"
|
"typescript": "^4.6.2"
|
||||||
},
|
},
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
// Protocol Buffers - Google's data interchange format
|
|
||||||
// Copyright 2008 Google Inc. All rights reserved.
|
|
||||||
// https://developers.google.com/protocol-buffers/
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package google.protobuf;
|
|
||||||
|
|
||||||
option cc_enable_arenas = true;
|
|
||||||
option go_package = "google.golang.org/protobuf/types/known/durationpb";
|
|
||||||
option java_package = "com.google.protobuf";
|
|
||||||
option java_outer_classname = "DurationProto";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option objc_class_prefix = "GPB";
|
|
||||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
||||||
|
|
||||||
// A Duration represents a signed, fixed-length span of time represented
|
|
||||||
// as a count of seconds and fractions of seconds at nanosecond
|
|
||||||
// resolution. It is independent of any calendar and concepts like "day"
|
|
||||||
// or "month". It is related to Timestamp in that the difference between
|
|
||||||
// two Timestamp values is a Duration and it can be added or subtracted
|
|
||||||
// from a Timestamp. Range is approximately +-10,000 years.
|
|
||||||
//
|
|
||||||
// # Examples
|
|
||||||
//
|
|
||||||
// Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
||||||
//
|
|
||||||
// Timestamp start = ...;
|
|
||||||
// Timestamp end = ...;
|
|
||||||
// Duration duration = ...;
|
|
||||||
//
|
|
||||||
// duration.seconds = end.seconds - start.seconds;
|
|
||||||
// duration.nanos = end.nanos - start.nanos;
|
|
||||||
//
|
|
||||||
// if (duration.seconds < 0 && duration.nanos > 0) {
|
|
||||||
// duration.seconds += 1;
|
|
||||||
// duration.nanos -= 1000000000;
|
|
||||||
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
|
||||||
// duration.seconds -= 1;
|
|
||||||
// duration.nanos += 1000000000;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
||||||
//
|
|
||||||
// Timestamp start = ...;
|
|
||||||
// Duration duration = ...;
|
|
||||||
// Timestamp end = ...;
|
|
||||||
//
|
|
||||||
// end.seconds = start.seconds + duration.seconds;
|
|
||||||
// end.nanos = start.nanos + duration.nanos;
|
|
||||||
//
|
|
||||||
// if (end.nanos < 0) {
|
|
||||||
// end.seconds -= 1;
|
|
||||||
// end.nanos += 1000000000;
|
|
||||||
// } else if (end.nanos >= 1000000000) {
|
|
||||||
// end.seconds += 1;
|
|
||||||
// end.nanos -= 1000000000;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Example 3: Compute Duration from datetime.timedelta in Python.
|
|
||||||
//
|
|
||||||
// td = datetime.timedelta(days=3, minutes=10)
|
|
||||||
// duration = Duration()
|
|
||||||
// duration.FromTimedelta(td)
|
|
||||||
//
|
|
||||||
// # JSON Mapping
|
|
||||||
//
|
|
||||||
// In JSON format, the Duration type is encoded as a string rather than an
|
|
||||||
// object, where the string ends in the suffix "s" (indicating seconds) and
|
|
||||||
// is preceded by the number of seconds, with nanoseconds expressed as
|
|
||||||
// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
||||||
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
||||||
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
||||||
// microsecond should be expressed in JSON format as "3.000001s".
|
|
||||||
//
|
|
||||||
message Duration {
|
|
||||||
// Signed seconds of the span of time. Must be from -315,576,000,000
|
|
||||||
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
||||||
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
||||||
int64 seconds = 1;
|
|
||||||
|
|
||||||
// Signed fractions of a second at nanosecond resolution of the span
|
|
||||||
// of time. Durations less than one second are represented with a 0
|
|
||||||
// `seconds` field and a positive or negative `nanos` field. For durations
|
|
||||||
// of one second or more, a non-zero value for the `nanos` field must be
|
|
||||||
// of the same sign as the `seconds` field. Must be from -999,999,999
|
|
||||||
// to +999,999,999 inclusive.
|
|
||||||
int32 nanos = 2;
|
|
||||||
}
|
|
@ -1,144 +0,0 @@
|
|||||||
// Protocol Buffers - Google's data interchange format
|
|
||||||
// Copyright 2008 Google Inc. All rights reserved.
|
|
||||||
// https://developers.google.com/protocol-buffers/
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package google.protobuf;
|
|
||||||
|
|
||||||
option cc_enable_arenas = true;
|
|
||||||
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
|
|
||||||
option java_package = "com.google.protobuf";
|
|
||||||
option java_outer_classname = "TimestampProto";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option objc_class_prefix = "GPB";
|
|
||||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
||||||
|
|
||||||
// A Timestamp represents a point in time independent of any time zone or local
|
|
||||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
|
||||||
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
||||||
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
||||||
// Gregorian calendar backwards to year one.
|
|
||||||
//
|
|
||||||
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
||||||
// second table is needed for interpretation, using a [24-hour linear
|
|
||||||
// smear](https://developers.google.com/time/smear).
|
|
||||||
//
|
|
||||||
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
||||||
// restricting to that range, we ensure that we can convert to and from [RFC
|
|
||||||
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
||||||
//
|
|
||||||
// # Examples
|
|
||||||
//
|
|
||||||
// Example 1: Compute Timestamp from POSIX `time()`.
|
|
||||||
//
|
|
||||||
// Timestamp timestamp;
|
|
||||||
// timestamp.set_seconds(time(NULL));
|
|
||||||
// timestamp.set_nanos(0);
|
|
||||||
//
|
|
||||||
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
||||||
//
|
|
||||||
// struct timeval tv;
|
|
||||||
// gettimeofday(&tv, NULL);
|
|
||||||
//
|
|
||||||
// Timestamp timestamp;
|
|
||||||
// timestamp.set_seconds(tv.tv_sec);
|
|
||||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
|
||||||
//
|
|
||||||
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
||||||
//
|
|
||||||
// FILETIME ft;
|
|
||||||
// GetSystemTimeAsFileTime(&ft);
|
|
||||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
||||||
//
|
|
||||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
||||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
||||||
// Timestamp timestamp;
|
|
||||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
||||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
||||||
//
|
|
||||||
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
||||||
//
|
|
||||||
// long millis = System.currentTimeMillis();
|
|
||||||
//
|
|
||||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
||||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
||||||
//
|
|
||||||
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
||||||
//
|
|
||||||
// Instant now = Instant.now();
|
|
||||||
//
|
|
||||||
// Timestamp timestamp =
|
|
||||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
||||||
// .setNanos(now.getNano()).build();
|
|
||||||
//
|
|
||||||
// Example 6: Compute Timestamp from current time in Python.
|
|
||||||
//
|
|
||||||
// timestamp = Timestamp()
|
|
||||||
// timestamp.GetCurrentTime()
|
|
||||||
//
|
|
||||||
// # JSON Mapping
|
|
||||||
//
|
|
||||||
// In JSON format, the Timestamp type is encoded as a string in the
|
|
||||||
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
||||||
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
||||||
// where {year} is always expressed using four digits while {month}, {day},
|
|
||||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
||||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
||||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
||||||
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
||||||
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
||||||
// able to accept both UTC and other timezones (as indicated by an offset).
|
|
||||||
//
|
|
||||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
||||||
// 01:30 UTC on January 15, 2017.
|
|
||||||
//
|
|
||||||
// In JavaScript, one can convert a Date object to this format using the
|
|
||||||
// standard
|
|
||||||
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
||||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
|
||||||
// to this format using
|
|
||||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
||||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
||||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
||||||
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
|
||||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
|
||||||
//
|
|
||||||
message Timestamp {
|
|
||||||
// Represents seconds of UTC time since Unix epoch
|
|
||||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
||||||
// 9999-12-31T23:59:59Z inclusive.
|
|
||||||
int64 seconds = 1;
|
|
||||||
|
|
||||||
// Non-negative fractions of a second at nanosecond resolution. Negative
|
|
||||||
// second values with fractions must still have non-negative nanos values
|
|
||||||
// that count forward in time. Must be from 0 to 999,999,999
|
|
||||||
// inclusive.
|
|
||||||
int32 nanos = 2;
|
|
||||||
}
|
|
131
proto/vulcanize/registry/v1beta1/attributes.proto
Normal file
131
proto/vulcanize/registry/v1beta1/attributes.proto
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package vulcanize.registry.v1beta1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||||
|
|
||||||
|
message ServiceProviderRegistration {
|
||||||
|
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||||
|
string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""];
|
||||||
|
X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""];
|
||||||
|
string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message X500 {
|
||||||
|
string common_name = 1 [(gogoproto.moretags) = "json:\"commonName\" yaml:\"commonName\""];
|
||||||
|
string organization_unit = 2 [(gogoproto.moretags) = "json:\"organizationUnit\" yaml:\"organizationUnit\""];
|
||||||
|
string organization_name = 3 [(gogoproto.moretags) = "json:\"organizationName\" yaml:\"organizationName\""];
|
||||||
|
string locality_name = 4 [(gogoproto.moretags) = "json:\"localityName\" yaml:\"localityName\""];
|
||||||
|
string state_name = 5 [(gogoproto.moretags) = "json:\"stateName\" yaml:\"stateName\""];
|
||||||
|
string country = 6 [(gogoproto.moretags) = "json:\"country\" yaml:\"country\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message WebsiteRegistrationRecord {
|
||||||
|
string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
||||||
|
string repo_registration_record_cid = 2
|
||||||
|
[(gogoproto.moretags) = "json:\"repoRegistrationRecordCID\" yaml:\"repoRegistrationRecordCID\""];
|
||||||
|
string build_artifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""];
|
||||||
|
string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""];
|
||||||
|
string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationRecord {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
|
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string homepage = 5 [(gogoproto.moretags) = "json:\"homepage\" yaml:\"homepage\""];
|
||||||
|
string license = 6 [(gogoproto.moretags) = "json:\"license\" yaml:\"license\""];
|
||||||
|
string author = 7 [(gogoproto.moretags) = "json:\"author\" yaml:\"author\""];
|
||||||
|
repeated string repository = 8 [(gogoproto.moretags) = "json:\"repository\" yaml:\"repository\""];
|
||||||
|
string repository_ref = 9 [(gogoproto.moretags) = "json:\"repositoryRef\" yaml:\"repositoryRef\""];
|
||||||
|
string app_version = 10 [(gogoproto.moretags) = "json:\"appVersion\" yaml:\"appVersion\""];
|
||||||
|
string app_type = 11 [(gogoproto.moretags) = "json:\"appType\" yaml:\"appType\""];
|
||||||
|
string engines = 12 [(gogoproto.moretags) = "json:\"engines\" yaml:\"engines\""];
|
||||||
|
repeated string os = 13 [(gogoproto.moretags) = "json:\"os\" yaml:\"os\""];
|
||||||
|
repeated string cpu = 14 [(gogoproto.moretags) = "json:\"cpu\" yaml:\"cpu\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationArtifact {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string description = 4 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
|
string version = 5 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string application = 6 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
||||||
|
string content_type = 7 [(gogoproto.moretags) = "json:\"contentType\" yaml:\"contentType\""];
|
||||||
|
string os = 8 [(gogoproto.moretags) = "json:\"os\" yaml:\"os\""];
|
||||||
|
string cpu = 9 [(gogoproto.moretags) = "json:\"cpu\" yaml:\"cpu\""];
|
||||||
|
repeated string uri = 10 [(gogoproto.moretags) = "json:\"uri\" yaml:\"uri\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message DnsRecord {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string resource_type = 4 [(gogoproto.moretags) = "json:\"resourceType\" yaml:\"resourceType\""];
|
||||||
|
string value = 5 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
|
||||||
|
string request = 6 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationDeploymentRequest {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string version = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string application = 4 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
||||||
|
string dns = 5 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
|
||||||
|
string config = 6 [(gogoproto.moretags) = "json:\"config\" yaml:\"config\""];
|
||||||
|
string deployment = 7 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationDeploymentRecord {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
|
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string application = 5 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
|
||||||
|
string url = 6 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""];
|
||||||
|
string dns = 7 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
|
||||||
|
string request = 8 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationDeploymentRemovalRequest {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string version = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string deployment = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
||||||
|
string request = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplicationDeploymentRemovalRecord {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string version = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string deployment = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
|
||||||
|
string request = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
||||||
|
|
||||||
|
message GeneralRecord {
|
||||||
|
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
|
||||||
|
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
|
||||||
|
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
|
||||||
|
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
|
||||||
|
string category = 5 [(gogoproto.moretags) = "json:\"category\" yaml:\"category\""];
|
||||||
|
string value = 6 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
|
||||||
|
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
|
||||||
|
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
|
||||||
|
}
|
@ -5,6 +5,7 @@ import "google/protobuf/duration.proto";
|
|||||||
import "google/protobuf/timestamp.proto";
|
import "google/protobuf/timestamp.proto";
|
||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
import "cosmos/base/v1beta1/coin.proto";
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
import "google/protobuf/any.proto";
|
||||||
|
|
||||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||||
|
|
||||||
@ -57,15 +58,15 @@ message Params {
|
|||||||
|
|
||||||
// Params defines the registry module records
|
// Params defines the registry module records
|
||||||
message Record {
|
message Record {
|
||||||
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
||||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||||
string create_time = 3 [(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""];
|
string create_time = 3 [(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""];
|
||||||
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""];
|
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""];
|
||||||
bool deleted = 5;
|
bool deleted = 5;
|
||||||
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
|
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
|
||||||
bytes attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
|
google.protobuf.Any attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
|
||||||
repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
|
repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
|
||||||
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthorityEntry defines the registry module AuthorityEntries
|
// AuthorityEntry defines the registry module AuthorityEntries
|
||||||
@ -130,4 +131,4 @@ message BlockChangeSet {
|
|||||||
message AuctionBidInfo {
|
message AuctionBidInfo {
|
||||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
||||||
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
|
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
|
||||||
}
|
}
|
12
scripts/create-proto-files.sh
Executable file
12
scripts/create-proto-files.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# NOTE: protoc is required
|
||||||
|
|
||||||
|
I=$(pwd)/proto
|
||||||
|
DEST_TS=$(pwd)/src/proto/
|
||||||
|
mkdir -p $DEST_TS
|
||||||
|
|
||||||
|
protoc \
|
||||||
|
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
|
||||||
|
--ts_out=$DEST_TS \
|
||||||
|
--proto_path=$I \
|
||||||
|
$(find $(pwd)/proto/vulcanize -iname "*.proto")
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# NOTE: protoc is required
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
REPO_ROOT=$(pwd)
|
|
||||||
I=$REPO_ROOT/proto
|
|
||||||
DEST_TS=$REPO_ROOT/src/proto/
|
|
||||||
|
|
||||||
echo "Generating protobuf files"
|
|
||||||
|
|
||||||
mkdir -p $DEST_TS
|
|
||||||
|
|
||||||
protoc \
|
|
||||||
--plugin=protoc-gen-ts=$REPO_ROOT/node_modules/.bin/protoc-gen-ts \
|
|
||||||
--ts_out=$DEST_TS \
|
|
||||||
--proto_path=$I \
|
|
||||||
$(find $REPO_ROOT/proto/vulcanize -iname "*.proto")
|
|
||||||
|
|
||||||
SED='sed -i'
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
||||||
SED='sed -i ""'
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Removing gRPC references..."
|
|
||||||
|
|
||||||
for file in $(find $REPO_ROOT/src/proto -type f)
|
|
||||||
do
|
|
||||||
line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':')
|
|
||||||
if [[ -n "$line" ]] && [[ "$line" -gt 0 ]]; then
|
|
||||||
echo "Processing file: $file"
|
|
||||||
$SED "${line}d" ${file}
|
|
||||||
functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':')
|
|
||||||
$SED "${functions},\$d" ${file}
|
|
||||||
echo '}' >> $file
|
|
||||||
fi
|
|
||||||
$SED '1s#^#/* eslint-disable */\n#' $file
|
|
||||||
$SED '1s#^#// @ts-nocheck\n#' $file
|
|
||||||
done
|
|
16
scripts/remove-grpc.sh
Executable file
16
scripts/remove-grpc.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo $PWD
|
||||||
|
for file in $(find src/proto -type f)
|
||||||
|
do
|
||||||
|
line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':')
|
||||||
|
if [[ $line -gt 0 ]];
|
||||||
|
then
|
||||||
|
echo "Processing file... $file"
|
||||||
|
sed -i "${line}d" ${file}
|
||||||
|
functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':')
|
||||||
|
sed -i "${functions},\$d" ${file}
|
||||||
|
echo '}' >> $file
|
||||||
|
fi
|
||||||
|
sed -i '1s#^#/* eslint-disable */\n#' $file
|
||||||
|
sed -i '1s#^#// @ts-nocheck\n#' $file
|
||||||
|
done
|
@ -166,6 +166,10 @@ export class Account {
|
|||||||
assert(message);
|
assert(message);
|
||||||
const eipMessageDomain: any = message.eipToSign.domain;
|
const eipMessageDomain: any = message.eipToSign.domain;
|
||||||
|
|
||||||
|
if(message.eipToSign.message.msgs[0].value.payload!=null){
|
||||||
|
message.eipToSign.message.msgs[0].value.payload.record.attributes.value=Array.from(message.eipToSign.message.msgs[0].value.payload.record.attributes.value)
|
||||||
|
}
|
||||||
|
|
||||||
const signature = signTypedData({
|
const signature = signTypedData({
|
||||||
data: {
|
data: {
|
||||||
types: message.eipToSign.types as MessageTypes,
|
types: message.eipToSign.types as MessageTypes,
|
||||||
|
@ -44,7 +44,11 @@ const MSG_SET_RECORD_TYPES = {
|
|||||||
{ name: 'create_time', type: 'string' },
|
{ name: 'create_time', type: 'string' },
|
||||||
{ name: 'expiry_time', type: 'string' },
|
{ name: 'expiry_time', type: 'string' },
|
||||||
{ name: 'deleted', type: 'bool' },
|
{ name: 'deleted', type: 'bool' },
|
||||||
{ name: 'attributes', type: 'bytes' },
|
{ name: 'attributes', type: 'TypePayloadRecordAttributes' },
|
||||||
|
],
|
||||||
|
TypePayloadRecordAttributes: [
|
||||||
|
{ name: 'type_url', type: 'string' },
|
||||||
|
{ name: 'value', type: 'uint8[]' },
|
||||||
],
|
],
|
||||||
TypePayloadSignatures: [
|
TypePayloadSignatures: [
|
||||||
{ name: 'sig', type: 'string' },
|
{ name: 'sig', type: 'string' },
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: cosmos/base/query/v1beta1/pagination.proto
|
* source: cosmos/base/query/v1beta1/pagination.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: cosmos/base/v1beta1/coin.proto
|
* source: cosmos/base/v1beta1/coin.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: gogoproto/gogo.proto
|
* source: gogoproto/gogo.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../google/protobuf/descriptor";
|
import * as dependency_1 from "./../google/protobuf/descriptor";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: google/api/annotations.proto
|
* source: google/api/annotations.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./http";
|
import * as dependency_1 from "./http";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: google/api/http.proto
|
* source: google/api/http.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
|
101
src/proto/google/protobuf/any.ts
Normal file
101
src/proto/google/protobuf/any.ts
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
|
* compiler version: 4.25.1
|
||||||
|
* source: google/protobuf/any.proto
|
||||||
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
|
import * as dependency_1 from "./../../gogoproto/gogo";
|
||||||
|
import * as pb_1 from "google-protobuf";
|
||||||
|
export namespace google.protobuf {
|
||||||
|
export class Any extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
type_url?: string;
|
||||||
|
value?: Uint8Array;
|
||||||
|
}) {
|
||||||
|
super();
|
||||||
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||||
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
|
if ("type_url" in data && data.type_url != undefined) {
|
||||||
|
this.type_url = data.type_url;
|
||||||
|
}
|
||||||
|
if ("value" in data && data.value != undefined) {
|
||||||
|
this.value = data.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get type_url() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||||
|
}
|
||||||
|
set type_url(value: string) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
get value() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 2, new Uint8Array(0)) as Uint8Array;
|
||||||
|
}
|
||||||
|
set value(value: Uint8Array) {
|
||||||
|
pb_1.Message.setField(this, 2, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
type_url?: string;
|
||||||
|
value?: Uint8Array;
|
||||||
|
}): Any {
|
||||||
|
const message = new Any({});
|
||||||
|
if (data.type_url != null) {
|
||||||
|
message.type_url = data.type_url;
|
||||||
|
}
|
||||||
|
if (data.value != null) {
|
||||||
|
message.value = data.value;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
type_url?: string;
|
||||||
|
value?: Uint8Array;
|
||||||
|
} = {};
|
||||||
|
if (this.type_url != null) {
|
||||||
|
data.type_url = this.type_url;
|
||||||
|
}
|
||||||
|
if (this.value != null) {
|
||||||
|
data.value = this.value;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||||
|
const writer = w || new pb_1.BinaryWriter();
|
||||||
|
if (this.type_url.length)
|
||||||
|
writer.writeString(1, this.type_url);
|
||||||
|
if (this.value.length)
|
||||||
|
writer.writeBytes(2, this.value);
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Any {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Any();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
message.type_url = reader.readString();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.value = reader.readBytes();
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Any {
|
||||||
|
return Any.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: google/protobuf/descriptor.proto
|
* source: google/protobuf/descriptor.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: google/protobuf/duration.proto
|
* source: google/protobuf/duration.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: google/protobuf/timestamp.proto
|
* source: google/protobuf/timestamp.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/auction/v1beta1/genesis.proto
|
* source: vulcanize/auction/v1beta1/genesis.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/auction/v1beta1/query.proto
|
* source: vulcanize/auction/v1beta1/query.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/auction/v1beta1/tx.proto
|
* source: vulcanize/auction/v1beta1/tx.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/auction/v1beta1/types.proto
|
* source: vulcanize/auction/v1beta1/types.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/bond/v1beta1/bond.proto
|
* source: vulcanize/bond/v1beta1/bond.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/bond/v1beta1/genesis.proto
|
* source: vulcanize/bond/v1beta1/genesis.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/bond/v1beta1/query.proto
|
* source: vulcanize/bond/v1beta1/query.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/bond/v1beta1/tx.proto
|
* source: vulcanize/bond/v1beta1/tx.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
2591
src/proto/vulcanize/registry/v1beta1/attributes.ts
Normal file
2591
src/proto/vulcanize/registry/v1beta1/attributes.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/registry/v1beta1/genesis.proto
|
* source: vulcanize/registry/v1beta1/genesis.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/registry/v1beta1/query.proto
|
* source: vulcanize/registry/v1beta1/query.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./registry";
|
import * as dependency_1 from "./registry";
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/registry/v1beta1/registry.proto
|
* source: vulcanize/registry/v1beta1/registry.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../google/protobuf/duration";
|
import * as dependency_1 from "./../../../google/protobuf/duration";
|
||||||
import * as dependency_2 from "./../../../google/protobuf/timestamp";
|
import * as dependency_2 from "./../../../google/protobuf/timestamp";
|
||||||
import * as dependency_3 from "./../../../gogoproto/gogo";
|
import * as dependency_3 from "./../../../gogoproto/gogo";
|
||||||
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
|
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
|
||||||
|
import * as dependency_5 from "./../../../google/protobuf/any";
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
export namespace vulcanize.registry.v1beta1 {
|
export namespace vulcanize.registry.v1beta1 {
|
||||||
export class Params extends pb_1.Message {
|
export class Params extends pb_1.Message {
|
||||||
@ -347,7 +348,7 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
expiry_time?: string;
|
expiry_time?: string;
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
owners?: string[];
|
owners?: string[];
|
||||||
attributes?: Uint8Array;
|
attributes?: dependency_5.google.protobuf.Any;
|
||||||
names?: string[];
|
names?: string[];
|
||||||
type?: string;
|
type?: string;
|
||||||
}) {
|
}) {
|
||||||
@ -420,10 +421,13 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
pb_1.Message.setField(this, 6, value);
|
pb_1.Message.setField(this, 6, value);
|
||||||
}
|
}
|
||||||
get attributes() {
|
get attributes() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array(0)) as Uint8Array;
|
return pb_1.Message.getWrapperField(this, dependency_5.google.protobuf.Any, 7) as dependency_5.google.protobuf.Any;
|
||||||
}
|
}
|
||||||
set attributes(value: Uint8Array) {
|
set attributes(value: dependency_5.google.protobuf.Any) {
|
||||||
pb_1.Message.setField(this, 7, value);
|
pb_1.Message.setWrapperField(this, 7, value);
|
||||||
|
}
|
||||||
|
get has_attributes() {
|
||||||
|
return pb_1.Message.getField(this, 7) != null;
|
||||||
}
|
}
|
||||||
get names() {
|
get names() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 8, []) as string[];
|
return pb_1.Message.getFieldWithDefault(this, 8, []) as string[];
|
||||||
@ -444,7 +448,7 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
expiry_time?: string;
|
expiry_time?: string;
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
owners?: string[];
|
owners?: string[];
|
||||||
attributes?: Uint8Array;
|
attributes?: ReturnType<typeof dependency_5.google.protobuf.Any.prototype.toObject>;
|
||||||
names?: string[];
|
names?: string[];
|
||||||
type?: string;
|
type?: string;
|
||||||
}): Record {
|
}): Record {
|
||||||
@ -468,7 +472,7 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
message.owners = data.owners;
|
message.owners = data.owners;
|
||||||
}
|
}
|
||||||
if (data.attributes != null) {
|
if (data.attributes != null) {
|
||||||
message.attributes = data.attributes;
|
message.attributes = dependency_5.google.protobuf.Any.fromObject(data.attributes);
|
||||||
}
|
}
|
||||||
if (data.names != null) {
|
if (data.names != null) {
|
||||||
message.names = data.names;
|
message.names = data.names;
|
||||||
@ -486,7 +490,7 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
expiry_time?: string;
|
expiry_time?: string;
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
owners?: string[];
|
owners?: string[];
|
||||||
attributes?: Uint8Array;
|
attributes?: ReturnType<typeof dependency_5.google.protobuf.Any.prototype.toObject>;
|
||||||
names?: string[];
|
names?: string[];
|
||||||
type?: string;
|
type?: string;
|
||||||
} = {};
|
} = {};
|
||||||
@ -509,7 +513,7 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
data.owners = this.owners;
|
data.owners = this.owners;
|
||||||
}
|
}
|
||||||
if (this.attributes != null) {
|
if (this.attributes != null) {
|
||||||
data.attributes = this.attributes;
|
data.attributes = this.attributes.toObject();
|
||||||
}
|
}
|
||||||
if (this.names != null) {
|
if (this.names != null) {
|
||||||
data.names = this.names;
|
data.names = this.names;
|
||||||
@ -535,8 +539,8 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
writer.writeBool(5, this.deleted);
|
writer.writeBool(5, this.deleted);
|
||||||
if (this.owners.length)
|
if (this.owners.length)
|
||||||
writer.writeRepeatedString(6, this.owners);
|
writer.writeRepeatedString(6, this.owners);
|
||||||
if (this.attributes.length)
|
if (this.has_attributes)
|
||||||
writer.writeBytes(7, this.attributes);
|
writer.writeMessage(7, this.attributes, () => this.attributes.serialize(writer));
|
||||||
if (this.names.length)
|
if (this.names.length)
|
||||||
writer.writeRepeatedString(8, this.names);
|
writer.writeRepeatedString(8, this.names);
|
||||||
if (this.type.length)
|
if (this.type.length)
|
||||||
@ -569,7 +573,7 @@ export namespace vulcanize.registry.v1beta1 {
|
|||||||
pb_1.Message.addToRepeatedField(message, 6, reader.readString());
|
pb_1.Message.addToRepeatedField(message, 6, reader.readString());
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
message.attributes = reader.readBytes();
|
reader.readMessage(message.attributes, () => message.attributes = dependency_5.google.protobuf.Any.deserialize(reader));
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
pb_1.Message.addToRepeatedField(message, 8, reader.readString());
|
pb_1.Message.addToRepeatedField(message, 8, reader.readString());
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
* compiler version: 3.12.4
|
* compiler version: 4.25.1
|
||||||
* source: vulcanize/registry/v1beta1/tx.proto
|
* source: vulcanize/registry/v1beta1/tx.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||||
|
19
src/types.ts
19
src/types.ts
@ -3,6 +3,8 @@ import { Validator } from 'jsonschema';
|
|||||||
|
|
||||||
import RecordSchema from './schema/record.json';
|
import RecordSchema from './schema/record.json';
|
||||||
import { Util } from './util';
|
import { Util } from './util';
|
||||||
|
import * as attributes from './proto/vulcanize/registry/v1beta1/attributes';
|
||||||
|
import * as any from './proto/google/protobuf/any';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record.
|
* Record.
|
||||||
@ -27,7 +29,22 @@ export class Record {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get attributes() {
|
get attributes() {
|
||||||
return Buffer.from(JSON.stringify(this._record), 'binary')
|
let a = new any.google.protobuf.Any();
|
||||||
|
|
||||||
|
if (this._record.type) {
|
||||||
|
const namespace: any = attributes.vulcanize.registry.v1beta1;
|
||||||
|
if (!namespace[this._record.type]) {
|
||||||
|
throw new Error(`Class not found: ${this._record.type}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = namespace[this._record.type].fromObject(this._record);
|
||||||
|
a = new any.google.protobuf.Any({
|
||||||
|
type_url: `/vulcanize.registry.v1beta1.${this._record.type}`,
|
||||||
|
value: value.serialize(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user