forked from cerc-io/laconic-sdk
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9176bb1a5a | ||
|
|
10a4ecd5f2 |
@@ -1,2 +0,0 @@
|
||||
Dockerfile
|
||||
node_modules
|
||||
@@ -1,2 +1 @@
|
||||
PRIVATE_KEY=75f719e613d05efab06a3f1dde5250b497723b13d4afa4f8ed80145764e40cf7
|
||||
COSMOS_CHAIN_ID=laconic_9000-1
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
name: Publish npm package to gitea
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
npm_publish:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [ 16.x ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: yarn
|
||||
- name: Run yarn build
|
||||
run: |
|
||||
yarn build
|
||||
- name: Configure git.vdb.to npm registry
|
||||
run: |
|
||||
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
|
||||
- name: Authenticate to git.vdb.to registry
|
||||
run: |
|
||||
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}"
|
||||
- name: npm publish
|
||||
run: |
|
||||
npm publish
|
||||
@@ -1,81 +0,0 @@
|
||||
name: Tests
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release/**
|
||||
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
jobs:
|
||||
sdk_tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout laconicd
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./laconicd/"
|
||||
repository: cerc-io/laconicd
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
- name: Environment
|
||||
run: ls -tlh && env
|
||||
- name: Start dockerd
|
||||
run: |
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: build containers scripts
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./build-laconicd-container.sh
|
||||
- name: build test-container
|
||||
run: docker build -t cerc-io/laconic-sdk-tester:local-test -f laconicd/tests/sdk_tests/Dockerfile-sdk .
|
||||
- name: start containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose up -d
|
||||
- name: run basic tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: |
|
||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconicd_rest_endpoint=http://laconicd:1317
|
||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||
sleep 30s
|
||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
|
||||
- name: stop containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose down
|
||||
- name: start auction containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose -f docker-compose-auctions.yml up -d
|
||||
- name: run auction tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: |
|
||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconicd_rest_endpoint=http://laconicd:1317
|
||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||
sleep 30s
|
||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:auctions"
|
||||
- name: start containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose down
|
||||
- name: start containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose -f docker-compose-nameservice.yml up -d
|
||||
- name: run nameservice expiry tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: |
|
||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconicd_rest_endpoint=http://laconicd:1317
|
||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||
sleep 30s
|
||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:nameservice-expiry"
|
||||
- name: stop nameservice containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose down
|
||||
@@ -1,32 +0,0 @@
|
||||
name: Publish npm package to gitea
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
npm_publish:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [ 16.x ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: yarn
|
||||
- name: Run yarn build
|
||||
run: |
|
||||
yarn build
|
||||
- name: Configure git.vdb.to npm registry
|
||||
run: |
|
||||
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
|
||||
- name: Authenticate to git.vdb.to registry
|
||||
run: |
|
||||
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}"
|
||||
- name: npm publish
|
||||
run: |
|
||||
npm publish
|
||||
@@ -1,72 +0,0 @@
|
||||
name: Tests
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release/**
|
||||
|
||||
jobs:
|
||||
sdk_tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout laconicd
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./laconicd/"
|
||||
repository: cerc-io/laconicd
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
- name: Environment
|
||||
run: ls -tlh && env
|
||||
- name: build containers scripts
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./build-laconicd-container.sh
|
||||
- name: build test-container
|
||||
run: docker build -t cerc-io/laconic-sdk-tester:local-test -f laconicd/tests/sdk_tests/Dockerfile-sdk .
|
||||
- name: start containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose up -d
|
||||
- name: run basic tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: |
|
||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconicd_rest_endpoint=http://laconicd:1317
|
||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||
sleep 30s
|
||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
|
||||
- name: stop containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose down
|
||||
- name: start auction containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose -f docker-compose-auctions.yml up -d
|
||||
- name: run auction tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: |
|
||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconicd_rest_endpoint=http://laconicd:1317
|
||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||
sleep 30s
|
||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:auctions"
|
||||
- name: start containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose down
|
||||
- name: start containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose -f docker-compose-nameservice.yml up -d
|
||||
- name: run nameservice expiry tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: |
|
||||
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconicd_rest_endpoint=http://laconicd:1317
|
||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||
sleep 30s
|
||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:nameservice-expiry"
|
||||
- name: stop nameservice containers
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose down
|
||||
@@ -1,4 +1,3 @@
|
||||
node_modules
|
||||
dist
|
||||
.env
|
||||
.idea*
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
|
||||
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
||||
ARG VARIANT=16-bullseye
|
||||
FROM node:${VARIANT}
|
||||
|
||||
ARG USERNAME=node
|
||||
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
||||
|
||||
# Add NPM global to PATH.
|
||||
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
||||
|
||||
RUN \
|
||||
# Configure global npm install location, use group to adapt to UID/GID changes
|
||||
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
|
||||
&& usermod -a -G npm ${USERNAME} \
|
||||
&& umask 0002 \
|
||||
&& mkdir -p ${NPM_GLOBAL} \
|
||||
&& touch /usr/local/etc/npmrc \
|
||||
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
|
||||
&& chmod g+s ${NPM_GLOBAL} \
|
||||
&& npm config -g set prefix ${NPM_GLOBAL} \
|
||||
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
|
||||
# Install eslint
|
||||
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
|
||||
&& npm cache clean --force > /dev/null 2>&1
|
||||
|
||||
WORKDIR /
|
||||
COPY entrypoint.sh .
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD node --version
|
||||
|
||||
WORKDIR /app/laconic-sdk
|
||||
|
||||
COPY package*.json .
|
||||
RUN yarn install
|
||||
COPY . .
|
||||
|
||||
WORKDIR /app/laconic-sdk
|
||||
@@ -1,6 +1,4 @@
|
||||
# laconic-sdk
|
||||
|
||||
Client library used by TS/JS applications to communicate with laconicd.
|
||||
# laconic-client
|
||||
|
||||
## Tests
|
||||
|
||||
@@ -26,7 +24,7 @@ Follow these steps to run the tests:
|
||||
|
||||
- Copy the private key and assign it to variable `PRIVATE_KEY` in the `.env` file.
|
||||
|
||||
- Run the tests in laconic-sdk repo:
|
||||
- Run the tests in laconic-client repo:
|
||||
|
||||
```bash
|
||||
yarn test
|
||||
@@ -57,7 +55,7 @@ Follow these steps to run the tests:
|
||||
- In laconicd repo run:
|
||||
|
||||
```bash
|
||||
TEST_REGISTRY_EXPIRY=true ./init.sh
|
||||
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
||||
```
|
||||
|
||||
- Export the private key and change it in `.env` file again using:
|
||||
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
/// <reference types="node" />
|
||||
import { Payload, Signature } from './types';
|
||||
/**
|
||||
* Registry account.
|
||||
*/
|
||||
export declare class Account {
|
||||
_privateKey: Buffer;
|
||||
_publicKey: Uint8Array;
|
||||
_encodedPubkey: string;
|
||||
_formattedCosmosAddress: string;
|
||||
_registryPublicKey: string;
|
||||
_registryAddress: string;
|
||||
_ethAddress: string;
|
||||
/**
|
||||
* Generate bip39 mnemonic.
|
||||
*/
|
||||
static generateMnemonic(): string;
|
||||
/**
|
||||
* Generate private key from mnemonic.
|
||||
*/
|
||||
static generateFromMnemonic(mnemonic: string): Promise<Account>;
|
||||
/**
|
||||
* New Account.
|
||||
*/
|
||||
constructor(privateKey: Buffer);
|
||||
get privateKey(): Buffer;
|
||||
get encodedPubkey(): string;
|
||||
get formattedCosmosAddress(): string;
|
||||
get registryPublicKey(): string;
|
||||
get registryAddress(): string;
|
||||
init(): void;
|
||||
/**
|
||||
* Get private key.
|
||||
*/
|
||||
getPrivateKey(): string;
|
||||
/**
|
||||
* Get cosmos address.
|
||||
*/
|
||||
getCosmosAddress(): string;
|
||||
/**
|
||||
* Get record signature.
|
||||
*/
|
||||
signRecord(record: any): Promise<Buffer>;
|
||||
signPayload(payload: Payload): Promise<Signature>;
|
||||
/**
|
||||
* Sign message.
|
||||
*/
|
||||
sign(message: any): string;
|
||||
}
|
||||
Vendored
+178
@@ -0,0 +1,178 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Account = void 0;
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const bip32_1 = __importDefault(require("bip32"));
|
||||
const ecc = __importStar(require("tiny-secp256k1"));
|
||||
const bip39 = __importStar(require("bip39"));
|
||||
const canonical_json_1 = __importDefault(require("canonical-json"));
|
||||
const secp256k1_1 = __importDefault(require("secp256k1"));
|
||||
const ethers_1 = require("ethers");
|
||||
const js_sha256_1 = require("js-sha256");
|
||||
const eth_sig_util_1 = require("@metamask/eth-sig-util");
|
||||
const crypto_1 = require("@cosmjs/crypto");
|
||||
const encoding_1 = require("@cosmjs/encoding");
|
||||
const address_converter_1 = require("@tharsis/address-converter");
|
||||
const amino_1 = require("@cosmjs/amino");
|
||||
const types_1 = require("./types");
|
||||
const AMINO_PREFIX = 'EB5AE98721';
|
||||
const HDPATH = "m/44'/60'/0'/0";
|
||||
const bip32 = (0, bip32_1.default)(ecc);
|
||||
/**
|
||||
* Registry account.
|
||||
*/
|
||||
class Account {
|
||||
/**
|
||||
* New Account.
|
||||
*/
|
||||
constructor(privateKey) {
|
||||
(0, assert_1.default)(privateKey);
|
||||
this._privateKey = privateKey;
|
||||
this.init();
|
||||
}
|
||||
/**
|
||||
* Generate bip39 mnemonic.
|
||||
*/
|
||||
static generateMnemonic() {
|
||||
return bip39.generateMnemonic();
|
||||
}
|
||||
/**
|
||||
* Generate private key from mnemonic.
|
||||
*/
|
||||
static generateFromMnemonic(mnemonic) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(mnemonic);
|
||||
const seed = yield bip39.mnemonicToSeed(mnemonic);
|
||||
const wallet = bip32.fromSeed(seed);
|
||||
const account = wallet.derivePath(HDPATH);
|
||||
const { privateKey } = account;
|
||||
(0, assert_1.default)(privateKey);
|
||||
return new Account(privateKey);
|
||||
});
|
||||
}
|
||||
get privateKey() {
|
||||
return this._privateKey;
|
||||
}
|
||||
get encodedPubkey() {
|
||||
return this._encodedPubkey;
|
||||
}
|
||||
get formattedCosmosAddress() {
|
||||
return this._formattedCosmosAddress;
|
||||
}
|
||||
get registryPublicKey() {
|
||||
return this._registryPublicKey;
|
||||
}
|
||||
get registryAddress() {
|
||||
return this._registryAddress;
|
||||
}
|
||||
init() {
|
||||
// Generate public key.
|
||||
this._publicKey = secp256k1_1.default.publicKeyCreate(this._privateKey);
|
||||
this._encodedPubkey = (0, amino_1.encodeSecp256k1Pubkey)(this._publicKey).value;
|
||||
// 2. Generate eth address.
|
||||
this._ethAddress = ethers_1.utils.computeAddress(this._publicKey);
|
||||
// 3. Generate cosmos-sdk formatted address.
|
||||
this._formattedCosmosAddress = (0, address_converter_1.ethToEthermint)(this._ethAddress);
|
||||
// 4. Generate registry formatted public key.
|
||||
const publicKeyInHex = AMINO_PREFIX + (0, encoding_1.toHex)(this._publicKey);
|
||||
this._registryPublicKey = Buffer.from(publicKeyInHex, 'hex').toString('base64');
|
||||
// 5. Generate registry formatted address.
|
||||
let publicKeySha256 = (0, js_sha256_1.sha256)(Buffer.from(publicKeyInHex, 'hex'));
|
||||
this._registryAddress = new crypto_1.Ripemd160().update((0, encoding_1.fromHex)(publicKeySha256)).digest().toString();
|
||||
}
|
||||
/**
|
||||
* Get private key.
|
||||
*/
|
||||
getPrivateKey() {
|
||||
return this._privateKey.toString('hex');
|
||||
}
|
||||
/**
|
||||
* Get cosmos address.
|
||||
*/
|
||||
getCosmosAddress() {
|
||||
return this._formattedCosmosAddress;
|
||||
}
|
||||
/**
|
||||
* Get record signature.
|
||||
*/
|
||||
signRecord(record) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(record);
|
||||
const recordAsJson = (0, canonical_json_1.default)(record);
|
||||
// Double sha256.
|
||||
const recordBytesToSign = Buffer.from((0, js_sha256_1.sha256)(Buffer.from((0, js_sha256_1.sha256)(Buffer.from(recordAsJson)), 'hex')), 'hex');
|
||||
// Sign message
|
||||
(0, assert_1.default)(recordBytesToSign);
|
||||
const messageToSignSha256 = (0, js_sha256_1.sha256)(recordBytesToSign);
|
||||
const messageToSignSha256InBytes = Buffer.from(messageToSignSha256, 'hex');
|
||||
const sigObj = secp256k1_1.default.ecdsaSign(messageToSignSha256InBytes, this.privateKey);
|
||||
return Buffer.from(sigObj.signature);
|
||||
});
|
||||
}
|
||||
signPayload(payload) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(payload);
|
||||
const { record } = payload;
|
||||
const messageToSign = record.getMessageToSign();
|
||||
const sig = yield this.signRecord(messageToSign);
|
||||
(0, assert_1.default)(this.registryPublicKey);
|
||||
const signature = new types_1.Signature(this.registryPublicKey, sig.toString('base64'));
|
||||
payload.addSignature(signature);
|
||||
return signature;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Sign message.
|
||||
*/
|
||||
sign(message) {
|
||||
(0, assert_1.default)(message);
|
||||
const eipMessageDomain = message.eipToSign.domain;
|
||||
const signature = (0, eth_sig_util_1.signTypedData)({
|
||||
data: {
|
||||
types: message.eipToSign.types,
|
||||
primaryType: message.eipToSign.primaryType,
|
||||
domain: eipMessageDomain,
|
||||
message: message.eipToSign.message
|
||||
},
|
||||
privateKey: this._privateKey,
|
||||
version: eth_sig_util_1.SignTypedDataVersion.V4
|
||||
});
|
||||
return signature;
|
||||
}
|
||||
}
|
||||
exports.Account = Account;
|
||||
Vendored
+183
@@ -0,0 +1,183 @@
|
||||
import { Chain, Sender, Fee, MessageSendParams } from '@tharsis/transactions';
|
||||
import { RegistryClient } from "./registry-client";
|
||||
import { Account } from "./account";
|
||||
import { MessageMsgAssociateBond, MessageMsgCancelBond, MessageMsgCreateBond, MessageMsgDissociateBond, MessageMsgDissociateRecords, MessageMsgReAssociateRecords, MessageMsgRefillBond, MessageMsgWithdrawBond } from "./messages/bond";
|
||||
import { MessageMsgDeleteName, MessageMsgSetAuthorityBond, MessageMsgSetName, MessageMsgSetRecord } from './messages/nameservice';
|
||||
import { MessageMsgCommitBid, MessageMsgRevealBid } from './messages/auction';
|
||||
export declare const parseTxResponse: (result: any, parseResponse?: ((data: string) => any) | undefined) => any;
|
||||
/**
|
||||
* Create an auction bid.
|
||||
*/
|
||||
export declare const createBid: (chainId: string, auctionId: string, bidderAddress: string, bidAmount: string, noise?: string | undefined) => Promise<{
|
||||
commitHash: string;
|
||||
reveal: {
|
||||
chainId: string;
|
||||
auctionId: string;
|
||||
bidderAddress: string;
|
||||
bidAmount: string;
|
||||
noise: string;
|
||||
};
|
||||
revealString: string;
|
||||
}>;
|
||||
export declare const isKeyValid: (key: string) => "" | RegExpMatchArray | null;
|
||||
export declare class Registry {
|
||||
_endpoints: {
|
||||
[key: string]: string;
|
||||
};
|
||||
_chainID: string;
|
||||
_chain: Chain;
|
||||
_client: RegistryClient;
|
||||
static processWriteError(error: string): string;
|
||||
constructor(restUrl: string, gqlUrl: string, chainId: string);
|
||||
/**
|
||||
* Get accounts by addresses.
|
||||
*/
|
||||
getAccounts(addresses: string[]): Promise<any>;
|
||||
get endpoints(): {
|
||||
[key: string]: string;
|
||||
};
|
||||
get chainID(): string;
|
||||
/**
|
||||
* Get server status.
|
||||
*/
|
||||
getStatus(): Promise<any>;
|
||||
/**
|
||||
* Get records by ids.
|
||||
*/
|
||||
getRecordsByIds(ids: string[], refs?: boolean): Promise<any>;
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
queryRecords(attributes: {
|
||||
[key: string]: any;
|
||||
}, all?: boolean, refs?: boolean): Promise<any>;
|
||||
/**
|
||||
* Resolve names to records.
|
||||
*/
|
||||
resolveNames(names: string[], refs?: boolean): Promise<any>;
|
||||
/**
|
||||
* Publish record.
|
||||
* @param transactionPrivateKey - private key in HEX to sign transaction.
|
||||
*/
|
||||
setRecord(params: {
|
||||
privateKey: string;
|
||||
record: any;
|
||||
bondId: string;
|
||||
}, transactionPrivateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Send coins.
|
||||
*/
|
||||
sendCoins(params: MessageSendParams, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Computes the next bondId for the given account private key.
|
||||
*/
|
||||
getNextBondId(privateKey: string): Promise<string>;
|
||||
/**
|
||||
* Get bonds by ids.
|
||||
*/
|
||||
getBondsByIds(ids: string[]): Promise<any>;
|
||||
/**
|
||||
* Query bonds by attributes.
|
||||
*/
|
||||
queryBonds(attributes?: {}): Promise<any>;
|
||||
/**
|
||||
* Create bond.
|
||||
*/
|
||||
createBond(params: MessageMsgCreateBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Refill bond.
|
||||
*/
|
||||
refillBond(params: MessageMsgRefillBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Withdraw (from) bond.
|
||||
*/
|
||||
withdrawBond(params: MessageMsgWithdrawBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Cancel bond.
|
||||
*/
|
||||
cancelBond(params: MessageMsgCancelBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Associate record with bond.
|
||||
*/
|
||||
associateBond(params: MessageMsgAssociateBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Dissociate record from bond.
|
||||
*/
|
||||
dissociateBond(params: MessageMsgDissociateBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Dissociate all records from bond.
|
||||
*/
|
||||
dissociateRecords(params: MessageMsgDissociateRecords, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Reassociate records (switch bond).
|
||||
*/
|
||||
reassociateRecords(params: MessageMsgReAssociateRecords, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Reserve authority.
|
||||
*/
|
||||
reserveAuthority(params: {
|
||||
name: string;
|
||||
owner?: string;
|
||||
}, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Set authority bond.
|
||||
*/
|
||||
setAuthorityBond(params: MessageMsgSetAuthorityBond, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Commit auction bid.
|
||||
*/
|
||||
commitBid(params: MessageMsgCommitBid, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Reveal auction bid.
|
||||
*/
|
||||
revealBid(params: MessageMsgRevealBid, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Get records by ids.
|
||||
*/
|
||||
getAuctionsByIds(ids: string[]): Promise<any>;
|
||||
/**
|
||||
* Lookup authorities by names.
|
||||
*/
|
||||
lookupAuthorities(names: string[], auction?: boolean): Promise<any>;
|
||||
/**
|
||||
* Set name (CRN) to record ID (CID).
|
||||
*/
|
||||
setName(params: MessageMsgSetName, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Lookup naming information.
|
||||
*/
|
||||
lookupNames(names: string[], history?: boolean): Promise<any>;
|
||||
/**
|
||||
* Delete name (CRN) mapping.
|
||||
*/
|
||||
deleteName(params: MessageMsgDeleteName, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Submit record transaction.
|
||||
* @param privateKey - private key in HEX to sign message.
|
||||
* @param txPrivateKey - private key in HEX to sign transaction.
|
||||
*/
|
||||
_submitRecordTx({ privateKey, record, bondId }: {
|
||||
privateKey: string;
|
||||
record: any;
|
||||
bondId: string;
|
||||
}, txPrivateKey: string, fee: Fee): Promise<any>;
|
||||
_submitRecordPayloadTx(params: MessageMsgSetRecord, privateKey: string, fee: Fee): Promise<any>;
|
||||
/**
|
||||
* Submit a generic Tx to the chain.
|
||||
*/
|
||||
_submitTx(message: any, privateKey: string, sender: Sender): Promise<any>;
|
||||
/**
|
||||
* https://evmos.dev/basics/chain_id.html
|
||||
*/
|
||||
_parseEthChainId(chainId: string): number;
|
||||
/**
|
||||
* Get sender used for creating message.
|
||||
*/
|
||||
_getSender(account: Account): Promise<{
|
||||
accountAddress: string;
|
||||
sequence: any;
|
||||
accountNumber: any;
|
||||
pubkey: string;
|
||||
}>;
|
||||
}
|
||||
export { Account };
|
||||
Vendored
+510
@@ -0,0 +1,510 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __rest = (this && this.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Account = exports.Registry = exports.isKeyValid = exports.createBid = exports.parseTxResponse = void 0;
|
||||
const is_url_1 = __importDefault(require("is-url"));
|
||||
const js_sha256_1 = require("js-sha256");
|
||||
const provider_1 = require("@tharsis/provider");
|
||||
const transactions_1 = require("@tharsis/transactions");
|
||||
const registry_client_1 = require("./registry-client");
|
||||
const account_1 = require("./account");
|
||||
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return account_1.Account; } });
|
||||
const txbuilder_1 = require("./txbuilder");
|
||||
const types_1 = require("./types");
|
||||
const util_1 = require("./util");
|
||||
const bond_1 = require("./messages/bond");
|
||||
const nameservice_1 = require("./messages/nameservice");
|
||||
const auction_1 = require("./messages/auction");
|
||||
const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd.';
|
||||
// Parse Tx response from cosmos-sdk.
|
||||
const parseTxResponse = (result, parseResponse) => {
|
||||
const { txhash: hash, height } = result, txResponse = __rest(result, ["txhash", "height"]);
|
||||
if (parseResponse) {
|
||||
txResponse.data = parseResponse(txResponse.data);
|
||||
}
|
||||
txResponse.events.forEach((event) => {
|
||||
event.attributes = event.attributes.map(({ key, value }) => ({
|
||||
key: Buffer.from(key, 'base64').toString('utf8'),
|
||||
value: Buffer.from(value, 'base64').toString('utf8')
|
||||
}));
|
||||
});
|
||||
return Object.assign({ hash, height }, txResponse);
|
||||
};
|
||||
exports.parseTxResponse = parseTxResponse;
|
||||
/**
|
||||
* Create an auction bid.
|
||||
*/
|
||||
const createBid = (chainId, auctionId, bidderAddress, bidAmount, noise) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
if (!noise) {
|
||||
noise = account_1.Account.generateMnemonic();
|
||||
}
|
||||
const reveal = {
|
||||
chainId,
|
||||
auctionId,
|
||||
bidderAddress,
|
||||
bidAmount,
|
||||
noise
|
||||
};
|
||||
const commitHash = yield util_1.Util.getContentId(reveal);
|
||||
const revealString = Buffer.from(JSON.stringify(reveal)).toString('hex');
|
||||
return {
|
||||
commitHash,
|
||||
reveal,
|
||||
revealString
|
||||
};
|
||||
});
|
||||
exports.createBid = createBid;
|
||||
const isKeyValid = (key) => key && key.match(/^[0-9a-fA-F]{64}$/);
|
||||
exports.isKeyValid = isKeyValid;
|
||||
class Registry {
|
||||
constructor(restUrl, gqlUrl, chainId) {
|
||||
if (!(0, is_url_1.default)(restUrl)) {
|
||||
throw new Error('Path to a REST endpoint should be provided.');
|
||||
}
|
||||
if (!(0, is_url_1.default)(gqlUrl)) {
|
||||
throw new Error('Path to a GQL endpoint should be provided.');
|
||||
}
|
||||
this._endpoints = {
|
||||
rest: restUrl,
|
||||
gql: gqlUrl
|
||||
};
|
||||
this._client = new registry_client_1.RegistryClient(restUrl, gqlUrl);
|
||||
this._chainID = chainId;
|
||||
this._chain = {
|
||||
cosmosChainId: chainId,
|
||||
chainId: this._parseEthChainId(chainId)
|
||||
};
|
||||
}
|
||||
static processWriteError(error) {
|
||||
// error string a stacktrace containing the message.
|
||||
// https://gist.github.com/nikugogoi/de55d390574ded3466abad8bffd81952#file-txresponse-js-L7
|
||||
const errorMessage = nameservice_1.NAMESERVICE_ERRORS.find(message => error.includes(message));
|
||||
if (!errorMessage) {
|
||||
console.error(error);
|
||||
}
|
||||
return errorMessage || DEFAULT_WRITE_ERROR;
|
||||
}
|
||||
/**
|
||||
* Get accounts by addresses.
|
||||
*/
|
||||
getAccounts(addresses) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.getAccounts(addresses);
|
||||
});
|
||||
}
|
||||
get endpoints() {
|
||||
return this._endpoints;
|
||||
}
|
||||
get chainID() {
|
||||
return this._chainID;
|
||||
}
|
||||
/**
|
||||
* Get server status.
|
||||
*/
|
||||
getStatus() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.getStatus();
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get records by ids.
|
||||
*/
|
||||
getRecordsByIds(ids, refs = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.getRecordsByIds(ids, refs);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
queryRecords(attributes, all = false, refs = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.queryRecords(attributes, all, refs);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Resolve names to records.
|
||||
*/
|
||||
resolveNames(names, refs = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.resolveNames(names, refs);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Publish record.
|
||||
* @param transactionPrivateKey - private key in HEX to sign transaction.
|
||||
*/
|
||||
setRecord(params, transactionPrivateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
result = yield this._submitRecordTx(params, transactionPrivateKey, fee);
|
||||
return (0, exports.parseTxResponse)(result, nameservice_1.parseMsgSetRecordResponse);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Send coins.
|
||||
*/
|
||||
sendCoins(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, transactions_1.createMessageSend)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Computes the next bondId for the given account private key.
|
||||
*/
|
||||
getNextBondId(privateKey) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const accounts = yield this.getAccounts([account.formattedCosmosAddress]);
|
||||
if (!accounts.length) {
|
||||
throw new Error('Account does not exist.');
|
||||
}
|
||||
const [accountObj] = accounts;
|
||||
const nextSeq = parseInt(accountObj.sequence, 10) + 1;
|
||||
result = (0, js_sha256_1.sha256)(`${accountObj.address}:${accountObj.number}:${nextSeq}`);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get bonds by ids.
|
||||
*/
|
||||
getBondsByIds(ids) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.getBondsByIds(ids);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Query bonds by attributes.
|
||||
*/
|
||||
queryBonds(attributes = {}) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.queryBonds(attributes);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Create bond.
|
||||
*/
|
||||
createBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgCreateBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Refill bond.
|
||||
*/
|
||||
refillBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgRefillBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Withdraw (from) bond.
|
||||
*/
|
||||
withdrawBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgWithdrawBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Cancel bond.
|
||||
*/
|
||||
cancelBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgCancelBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Associate record with bond.
|
||||
*/
|
||||
associateBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgAssociateBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Dissociate record from bond.
|
||||
*/
|
||||
dissociateBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgDissociateBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Dissociate all records from bond.
|
||||
*/
|
||||
dissociateRecords(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgDissociateRecords)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Reassociate records (switch bond).
|
||||
*/
|
||||
reassociateRecords(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, bond_1.createTxMsgReAssociateRecords)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Reserve authority.
|
||||
*/
|
||||
reserveAuthority(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msgParams = {
|
||||
name: params.name,
|
||||
owner: params.owner || sender.accountAddress
|
||||
};
|
||||
const msg = (0, nameservice_1.createTxMsgReserveAuthority)(this._chain, sender, fee, '', msgParams);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Set authority bond.
|
||||
*/
|
||||
setAuthorityBond(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, nameservice_1.createTxMsgSetAuthorityBond)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Commit auction bid.
|
||||
*/
|
||||
commitBid(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, auction_1.createTxMsgCommitBid)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Reveal auction bid.
|
||||
*/
|
||||
revealBid(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, auction_1.createTxMsgRevealBid)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get records by ids.
|
||||
*/
|
||||
getAuctionsByIds(ids) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.getAuctionsByIds(ids);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Lookup authorities by names.
|
||||
*/
|
||||
lookupAuthorities(names, auction = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.lookupAuthorities(names, auction);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Set name (CRN) to record ID (CID).
|
||||
*/
|
||||
setName(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, nameservice_1.createTxMsgSetName)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Lookup naming information.
|
||||
*/
|
||||
lookupNames(names, history = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this._client.lookupNames(names, history);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Delete name (CRN) mapping.
|
||||
*/
|
||||
deleteName(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let result;
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, nameservice_1.createTxMsgDeleteName)(this._chain, sender, fee, '', params);
|
||||
result = yield this._submitTx(msg, privateKey, sender);
|
||||
return (0, exports.parseTxResponse)(result);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Submit record transaction.
|
||||
* @param privateKey - private key in HEX to sign message.
|
||||
* @param txPrivateKey - private key in HEX to sign transaction.
|
||||
*/
|
||||
_submitRecordTx({ privateKey, record, bondId }, txPrivateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!(0, exports.isKeyValid)(privateKey)) {
|
||||
throw new Error('Registry privateKey should be a hex string.');
|
||||
}
|
||||
if (!(0, exports.isKeyValid)(bondId)) {
|
||||
throw new Error(`Invalid bondId: ${bondId}.`);
|
||||
}
|
||||
// Sign record.
|
||||
const recordSignerAccount = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const registryRecord = new types_1.Record(record);
|
||||
const payload = new types_1.Payload(registryRecord);
|
||||
yield recordSignerAccount.signPayload(payload);
|
||||
// Send record payload Tx.
|
||||
txPrivateKey = txPrivateKey || recordSignerAccount.getPrivateKey();
|
||||
return this._submitRecordPayloadTx({ payload, bondId }, txPrivateKey, fee);
|
||||
});
|
||||
}
|
||||
_submitRecordPayloadTx(params, privateKey, fee) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!(0, exports.isKeyValid)(privateKey)) {
|
||||
throw new Error('Registry privateKey should be a hex string.');
|
||||
}
|
||||
if (!(0, exports.isKeyValid)(params.bondId)) {
|
||||
throw new Error(`Invalid bondId: ${params.bondId}.`);
|
||||
}
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
const sender = yield this._getSender(account);
|
||||
const msg = (0, nameservice_1.createTxMsgSetRecord)(this._chain, sender, fee, '', params);
|
||||
return this._submitTx(msg, privateKey, sender);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Submit a generic Tx to the chain.
|
||||
*/
|
||||
_submitTx(message, privateKey, sender) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Check private key.
|
||||
if (!(0, exports.isKeyValid)(privateKey)) {
|
||||
throw new Error('Registry privateKey should be a hex string.');
|
||||
}
|
||||
// Check that the account exists on-chain.
|
||||
const account = new account_1.Account(Buffer.from(privateKey, 'hex'));
|
||||
// Generate signed Tx.
|
||||
const transaction = (0, txbuilder_1.createTransaction)(message, account, sender, this._chain);
|
||||
const tx = (0, provider_1.generatePostBodyBroadcast)(transaction, provider_1.BroadcastMode.Block);
|
||||
// Submit Tx to chain.
|
||||
const { tx_response: response } = yield this._client.submit(tx);
|
||||
if (response.code !== 0) {
|
||||
// Throw error when transaction is not successful.
|
||||
// https://docs.starport.com/guide/nameservice/05-play.html#buy-name-transaction-details
|
||||
throw new Error(Registry.processWriteError(response.raw_log));
|
||||
}
|
||||
return response;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* https://evmos.dev/basics/chain_id.html
|
||||
*/
|
||||
_parseEthChainId(chainId) {
|
||||
const [idWithChainNumber] = chainId.split('-');
|
||||
const [_, ethChainId] = idWithChainNumber.split('_');
|
||||
return Number(ethChainId);
|
||||
}
|
||||
/**
|
||||
* Get sender used for creating message.
|
||||
*/
|
||||
_getSender(account) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const accounts = yield this.getAccounts([account.formattedCosmosAddress]);
|
||||
if (!accounts.length) {
|
||||
throw new Error('Account does not exist.');
|
||||
}
|
||||
const [{ number, sequence }] = accounts;
|
||||
return {
|
||||
accountAddress: account.formattedCosmosAddress,
|
||||
sequence: sequence,
|
||||
accountNumber: number,
|
||||
pubkey: account.encodedPubkey,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.Registry = Registry;
|
||||
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
import { Chain, Sender, Fee } from '@tharsis/transactions';
|
||||
export interface MessageMsgCommitBid {
|
||||
auctionId: string;
|
||||
commitHash: string;
|
||||
}
|
||||
export interface MessageMsgRevealBid {
|
||||
auctionId: string;
|
||||
reveal: string;
|
||||
}
|
||||
export declare function createTxMsgCommitBid(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgCommitBid): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgRevealBid(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgRevealBid): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
Vendored
+99
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTxMsgRevealBid = exports.createTxMsgCommitBid = void 0;
|
||||
const eip712_1 = require("@tharsis/eip712");
|
||||
const auctionTx = __importStar(require("../proto/vulcanize/auction/v1beta1/tx"));
|
||||
const util_1 = require("./util");
|
||||
const MSG_COMMIT_BID_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'auction_id', type: 'string' },
|
||||
{ name: 'commit_hash', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
const MSG_REVEAL_BID_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'auction_id', type: 'string' },
|
||||
{ name: 'reveal', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
function createTxMsgCommitBid(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_COMMIT_BID_TYPES);
|
||||
const msg = createMsgCommitBid(params.auctionId, params.commitHash, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgCommitBid(params.auctionId, params.commitHash, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgCommitBid = createTxMsgCommitBid;
|
||||
function createTxMsgRevealBid(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_REVEAL_BID_TYPES);
|
||||
const msg = createMsgRevealBid(params.auctionId, params.reveal, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgRevealBid(params.auctionId, params.reveal, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgRevealBid = createTxMsgRevealBid;
|
||||
function createMsgCommitBid(auctionId, commitHash, signer) {
|
||||
return {
|
||||
type: 'auction/MsgCommitBid',
|
||||
value: {
|
||||
auction_id: auctionId,
|
||||
commit_hash: commitHash,
|
||||
signer,
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgCommitBid = (auctionId, commitHash, signer) => {
|
||||
const commitBidMessage = new auctionTx.vulcanize.auction.v1beta1.MsgCommitBid({
|
||||
auction_id: auctionId,
|
||||
commit_hash: commitHash,
|
||||
signer,
|
||||
});
|
||||
return {
|
||||
message: commitBidMessage,
|
||||
path: 'vulcanize.auction.v1beta1.MsgCommitBid',
|
||||
};
|
||||
};
|
||||
function createMsgRevealBid(auctionId, reveal, signer) {
|
||||
return {
|
||||
type: 'auction/MsgRevealBid',
|
||||
value: {
|
||||
auction_id: auctionId,
|
||||
reveal,
|
||||
signer,
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgRevealBid = (auctionId, reveal, signer) => {
|
||||
const revealBidMessage = new auctionTx.vulcanize.auction.v1beta1.MsgRevealBid({
|
||||
auction_id: auctionId,
|
||||
reveal,
|
||||
signer,
|
||||
});
|
||||
return {
|
||||
message: revealBidMessage,
|
||||
path: 'vulcanize.auction.v1beta1.MsgRevealBid',
|
||||
};
|
||||
};
|
||||
Vendored
+224
@@ -0,0 +1,224 @@
|
||||
import { Chain, Sender, Fee } from '@tharsis/transactions';
|
||||
export interface MessageMsgCreateBond {
|
||||
amount: string;
|
||||
denom: string;
|
||||
}
|
||||
export interface MessageMsgRefillBond {
|
||||
id: string;
|
||||
amount: string;
|
||||
denom: string;
|
||||
}
|
||||
export interface MessageMsgWithdrawBond {
|
||||
id: string;
|
||||
amount: string;
|
||||
denom: string;
|
||||
}
|
||||
export interface MessageMsgCancelBond {
|
||||
id: string;
|
||||
}
|
||||
export interface MessageMsgAssociateBond {
|
||||
bondId: string;
|
||||
recordId: string;
|
||||
}
|
||||
export interface MessageMsgDissociateBond {
|
||||
recordId: string;
|
||||
}
|
||||
export interface MessageMsgDissociateRecords {
|
||||
bondId: string;
|
||||
}
|
||||
export interface MessageMsgReAssociateRecords {
|
||||
newBondId: string;
|
||||
oldBondId: string;
|
||||
}
|
||||
export declare function createTxMsgCreateBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgCreateBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgRefillBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgRefillBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgWithdrawBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgWithdrawBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgCancelBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgCancelBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgAssociateBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgAssociateBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgDissociateBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgDissociateBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgDissociateRecords(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgDissociateRecords): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgReAssociateRecords(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgReAssociateRecords): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
Vendored
+338
@@ -0,0 +1,338 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTxMsgReAssociateRecords = exports.createTxMsgDissociateRecords = exports.createTxMsgDissociateBond = exports.createTxMsgAssociateBond = exports.createTxMsgCancelBond = exports.createTxMsgWithdrawBond = exports.createTxMsgRefillBond = exports.createTxMsgCreateBond = void 0;
|
||||
const eip712_1 = require("@tharsis/eip712");
|
||||
const bondTx = __importStar(require("../proto/vulcanize/bond/v1beta1/tx"));
|
||||
const nameserviceTx = __importStar(require("../proto/vulcanize/nameservice/v1beta1/tx"));
|
||||
const coin = __importStar(require("../proto/cosmos/base/v1beta1/coin"));
|
||||
const util_1 = require("./util");
|
||||
const MSG_CREATE_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'signer', type: 'string' },
|
||||
{ name: 'coins', type: 'TypeCoins[]' },
|
||||
],
|
||||
TypeCoins: [
|
||||
{ name: 'denom', type: 'string' },
|
||||
{ name: 'amount', type: 'string' },
|
||||
],
|
||||
};
|
||||
const MSG_REFILL_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
{ name: 'coins', type: 'TypeCoins[]' },
|
||||
],
|
||||
TypeCoins: [
|
||||
{ name: 'denom', type: 'string' },
|
||||
{ name: 'amount', type: 'string' },
|
||||
],
|
||||
};
|
||||
const MSG_WITHDRAW_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
{ name: 'coins', type: 'TypeCoins[]' },
|
||||
],
|
||||
TypeCoins: [
|
||||
{ name: 'denom', type: 'string' },
|
||||
{ name: 'amount', type: 'string' },
|
||||
],
|
||||
};
|
||||
const MSG_CANCEL_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
const MSG_ASSOCIATE_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'record_id', type: 'string' },
|
||||
{ name: 'bond_id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
const MSG_DISSOCIATE_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'record_id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
const MSG_DISSOCIATE_RECORDS_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'bond_id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
const MSG_REASSOCIATE_RECORDS_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'new_bond_id', type: 'string' },
|
||||
{ name: 'old_bond_id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
]
|
||||
};
|
||||
function createTxMsgCreateBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_CREATE_BOND_TYPES);
|
||||
const msg = createMsgCreateBond(sender.accountAddress, params.amount, params.denom);
|
||||
const msgCosmos = protoCreateMsgCreateBond(sender.accountAddress, params.amount, params.denom);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgCreateBond = createTxMsgCreateBond;
|
||||
function createTxMsgRefillBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_REFILL_BOND_TYPES);
|
||||
const msg = createMsgRefillBond(params.id, sender.accountAddress, params.amount, params.denom);
|
||||
const msgCosmos = protoCreateMsgRefillBond(params.id, sender.accountAddress, params.amount, params.denom);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgRefillBond = createTxMsgRefillBond;
|
||||
function createTxMsgWithdrawBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_WITHDRAW_BOND_TYPES);
|
||||
const msg = createMsgWithdrawBond(params.id, sender.accountAddress, params.amount, params.denom);
|
||||
const msgCosmos = protoCreateMsgWithdrawBond(params.id, sender.accountAddress, params.amount, params.denom);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgWithdrawBond = createTxMsgWithdrawBond;
|
||||
function createTxMsgCancelBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_CANCEL_BOND_TYPES);
|
||||
const msg = createMsgCancelBond(params.id, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgCancelBond(params.id, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgCancelBond = createTxMsgCancelBond;
|
||||
function createTxMsgAssociateBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_ASSOCIATE_BOND_TYPES);
|
||||
const msg = createMsgAssociateBond(params.recordId, params.bondId, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgAssociateBond(params.recordId, params.bondId, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgAssociateBond = createTxMsgAssociateBond;
|
||||
function createTxMsgDissociateBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_DISSOCIATE_BOND_TYPES);
|
||||
const msg = createMsgDissociateBond(params.recordId, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgDissociateBond(params.recordId, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgDissociateBond = createTxMsgDissociateBond;
|
||||
function createTxMsgDissociateRecords(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_DISSOCIATE_RECORDS_TYPES);
|
||||
const msg = createMsgDissociateRecords(params.bondId, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgDissociateRecords(params.bondId, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgDissociateRecords = createTxMsgDissociateRecords;
|
||||
function createTxMsgReAssociateRecords(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_REASSOCIATE_RECORDS_TYPES);
|
||||
const msg = createMsgReAssociateRecords(params.newBondId, params.oldBondId, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgReAssociateRecords(params.newBondId, params.oldBondId, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgReAssociateRecords = createTxMsgReAssociateRecords;
|
||||
function createMsgCreateBond(signer, amount, denom) {
|
||||
return {
|
||||
type: 'bond/MsgCreateBond',
|
||||
value: {
|
||||
coins: [
|
||||
{
|
||||
amount,
|
||||
denom,
|
||||
},
|
||||
],
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgCreateBond = (signer, amount, denom) => {
|
||||
const value = new coin.cosmos.base.v1beta1.Coin({
|
||||
denom,
|
||||
amount,
|
||||
});
|
||||
const createBondMessage = new bondTx.vulcanize.bond.v1beta1.MsgCreateBond({
|
||||
signer,
|
||||
coins: [value]
|
||||
});
|
||||
return {
|
||||
message: createBondMessage,
|
||||
path: 'vulcanize.bond.v1beta1.MsgCreateBond',
|
||||
};
|
||||
};
|
||||
function createMsgRefillBond(id, signer, amount, denom) {
|
||||
return {
|
||||
type: 'bond/MsgRefillBond',
|
||||
value: {
|
||||
coins: [
|
||||
{
|
||||
amount,
|
||||
denom,
|
||||
},
|
||||
],
|
||||
id,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgRefillBond = (id, signer, amount, denom) => {
|
||||
const value = new coin.cosmos.base.v1beta1.Coin({
|
||||
denom,
|
||||
amount,
|
||||
});
|
||||
const refillBondMessage = new bondTx.vulcanize.bond.v1beta1.MsgRefillBond({
|
||||
id,
|
||||
signer,
|
||||
coins: [value]
|
||||
});
|
||||
return {
|
||||
message: refillBondMessage,
|
||||
path: 'vulcanize.bond.v1beta1.MsgRefillBond',
|
||||
};
|
||||
};
|
||||
function createMsgWithdrawBond(id, signer, amount, denom) {
|
||||
return {
|
||||
type: 'bond/MsgWithdrawBond',
|
||||
value: {
|
||||
id,
|
||||
coins: [
|
||||
{
|
||||
amount,
|
||||
denom,
|
||||
},
|
||||
],
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgWithdrawBond = (id, signer, amount, denom) => {
|
||||
const value = new coin.cosmos.base.v1beta1.Coin({
|
||||
denom,
|
||||
amount,
|
||||
});
|
||||
const withdrawBondMessage = new bondTx.vulcanize.bond.v1beta1.MsgWithdrawBond({
|
||||
id,
|
||||
signer,
|
||||
coins: [value]
|
||||
});
|
||||
return {
|
||||
message: withdrawBondMessage,
|
||||
path: 'vulcanize.bond.v1beta1.MsgWithdrawBond',
|
||||
};
|
||||
};
|
||||
function createMsgCancelBond(id, signer) {
|
||||
return {
|
||||
type: 'bond/MsgCancelBond',
|
||||
value: {
|
||||
id,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgCancelBond = (id, signer) => {
|
||||
const cancelBondMessage = new bondTx.vulcanize.bond.v1beta1.MsgCancelBond({
|
||||
id,
|
||||
signer
|
||||
});
|
||||
return {
|
||||
message: cancelBondMessage,
|
||||
path: 'vulcanize.bond.v1beta1.MsgCancelBond',
|
||||
};
|
||||
};
|
||||
function createMsgAssociateBond(recordId, bondId, signer) {
|
||||
return {
|
||||
type: 'nameservice/AssociateBond',
|
||||
value: {
|
||||
record_id: recordId,
|
||||
bond_id: bondId,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgAssociateBond = (recordId, bondId, signer) => {
|
||||
const associateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgAssociateBond({
|
||||
record_id: recordId,
|
||||
bond_id: bondId,
|
||||
signer
|
||||
});
|
||||
return {
|
||||
message: associateBondMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgAssociateBond',
|
||||
};
|
||||
};
|
||||
function createMsgDissociateBond(recordId, signer) {
|
||||
return {
|
||||
type: 'nameservice/DissociateBond',
|
||||
value: {
|
||||
record_id: recordId,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgDissociateBond = (recordId, signer) => {
|
||||
const dissociateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateBond({
|
||||
record_id: recordId,
|
||||
signer
|
||||
});
|
||||
return {
|
||||
message: dissociateBondMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgDissociateBond',
|
||||
};
|
||||
};
|
||||
function createMsgDissociateRecords(bondId, signer) {
|
||||
return {
|
||||
type: 'nameservice/DissociateRecords',
|
||||
value: {
|
||||
bond_id: bondId,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgDissociateRecords = (bondId, signer) => {
|
||||
const dissociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateRecords({
|
||||
bond_id: bondId,
|
||||
signer
|
||||
});
|
||||
return {
|
||||
message: dissociateRecordsMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgDissociateRecords',
|
||||
};
|
||||
};
|
||||
function createMsgReAssociateRecords(newBondId, oldBondId, signer) {
|
||||
return {
|
||||
type: 'nameservice/ReassociateRecords',
|
||||
value: {
|
||||
new_bond_id: newBondId,
|
||||
old_bond_id: oldBondId,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgReAssociateRecords = (newBondId, oldBondId, signer) => {
|
||||
const reAssociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReAssociateRecords({
|
||||
new_bond_id: newBondId,
|
||||
old_bond_id: oldBondId,
|
||||
signer
|
||||
});
|
||||
return {
|
||||
message: reAssociateRecordsMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgReAssociateRecords',
|
||||
};
|
||||
};
|
||||
Vendored
+145
@@ -0,0 +1,145 @@
|
||||
import { Chain, Sender, Fee } from '@tharsis/transactions';
|
||||
import { Payload } from '../types';
|
||||
export declare const parseMsgSetRecordResponse: (data: string) => {
|
||||
id: string;
|
||||
};
|
||||
export declare const NAMESERVICE_ERRORS: string[];
|
||||
export interface MessageMsgReserveAuthority {
|
||||
name: string;
|
||||
owner: string;
|
||||
}
|
||||
export interface MessageMsgSetName {
|
||||
crn: string;
|
||||
cid: string;
|
||||
}
|
||||
export interface MessageMsgSetRecord {
|
||||
bondId: string;
|
||||
payload: Payload;
|
||||
}
|
||||
export interface MessageMsgSetAuthorityBond {
|
||||
name: string;
|
||||
bondId: string;
|
||||
}
|
||||
export interface MessageMsgDeleteName {
|
||||
crn: string;
|
||||
}
|
||||
export declare function createTxMsgReserveAuthority(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgReserveAuthority): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgSetName(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgSetName): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgSetRecord(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgSetRecord): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgSetAuthorityBond(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgSetAuthorityBond): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export declare function createTxMsgDeleteName(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MessageMsgDeleteName): {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
Vendored
+240
@@ -0,0 +1,240 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTxMsgDeleteName = exports.createTxMsgSetAuthorityBond = exports.createTxMsgSetRecord = exports.createTxMsgSetName = exports.createTxMsgReserveAuthority = exports.NAMESERVICE_ERRORS = exports.parseMsgSetRecordResponse = void 0;
|
||||
const eip712_1 = require("@tharsis/eip712");
|
||||
const nameserviceTx = __importStar(require("../proto/vulcanize/nameservice/v1beta1/tx"));
|
||||
const nameservice = __importStar(require("../proto/vulcanize/nameservice/v1beta1/nameservice"));
|
||||
const util_1 = require("./util");
|
||||
const MSG_RESERVE_AUTHORITY_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'name', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
{ name: 'owner', type: 'string' },
|
||||
],
|
||||
};
|
||||
const MSG_SET_NAME_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'crn', type: 'string' },
|
||||
{ name: 'cid', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
],
|
||||
};
|
||||
const MSG_SET_RECORD_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'bond_id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
{ name: 'payload', type: 'TypePayload' },
|
||||
],
|
||||
TypePayload: [
|
||||
{ name: 'record', type: 'TypePayloadRecord' },
|
||||
{ name: 'signatures', type: 'TypePayloadSignatures[]' },
|
||||
],
|
||||
TypePayloadRecord: [
|
||||
{ name: 'id', type: 'string' },
|
||||
{ name: 'bond_id', type: 'string' },
|
||||
{ name: 'create_time', type: 'string' },
|
||||
{ name: 'expiry_time', type: 'string' },
|
||||
{ name: 'deleted', type: 'bool' },
|
||||
{ name: 'attributes', type: 'string' },
|
||||
],
|
||||
TypePayloadSignatures: [
|
||||
{ name: 'sig', type: 'string' },
|
||||
{ name: 'pub_key', type: 'string' }
|
||||
],
|
||||
};
|
||||
const MSG_SET_AUTHORITY_BOND_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'name', type: 'string' },
|
||||
{ name: 'bond_id', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
],
|
||||
};
|
||||
const MSG_DELETE_NAME_TYPES = {
|
||||
MsgValue: [
|
||||
{ name: 'crn', type: 'string' },
|
||||
{ name: 'signer', type: 'string' },
|
||||
],
|
||||
};
|
||||
const parseMsgSetRecordResponse = (data) => {
|
||||
const responseBytes = Buffer.from(data, 'hex');
|
||||
// TODO: Decode response using protobuf.
|
||||
// const msgSetRecordResponse = nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetRecordResponse.deserialize(responseBytes);
|
||||
// return msgSetRecordResponse.toObject();
|
||||
// Workaround as proto based decoding is not working.
|
||||
const [_, id] = responseBytes.toString().split(';');
|
||||
return { id };
|
||||
};
|
||||
exports.parseMsgSetRecordResponse = parseMsgSetRecordResponse;
|
||||
exports.NAMESERVICE_ERRORS = [
|
||||
'Name already reserved.',
|
||||
'Authority bond not found.',
|
||||
'Name authority not found.',
|
||||
'Access denied.',
|
||||
];
|
||||
function createTxMsgReserveAuthority(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_RESERVE_AUTHORITY_TYPES);
|
||||
const msg = createMsgReserveAuthority(params.name, sender.accountAddress, params.owner);
|
||||
const msgCosmos = protoCreateMsgReserveAuthority(params.name, sender.accountAddress, params.owner);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgReserveAuthority = createTxMsgReserveAuthority;
|
||||
function createTxMsgSetName(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_SET_NAME_TYPES);
|
||||
const msg = createMsgSetName(params.crn, params.cid, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgSetName(params.crn, params.cid, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgSetName = createTxMsgSetName;
|
||||
function createTxMsgSetRecord(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_SET_RECORD_TYPES);
|
||||
const msg = createMsgSetRecord(params.bondId, params.payload, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgSetRecord(params.bondId, params.payload, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgSetRecord = createTxMsgSetRecord;
|
||||
function createTxMsgSetAuthorityBond(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_SET_AUTHORITY_BOND_TYPES);
|
||||
const msg = createMsgSetAuthorityBond(params.name, params.bondId, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgSetAuthorityBond(params.name, params.bondId, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgSetAuthorityBond = createTxMsgSetAuthorityBond;
|
||||
function createTxMsgDeleteName(chain, sender, fee, memo, params) {
|
||||
const types = (0, eip712_1.generateTypes)(MSG_DELETE_NAME_TYPES);
|
||||
const msg = createMsgDeleteName(params.crn, sender.accountAddress);
|
||||
const msgCosmos = protoCreateMsgDeleteName(params.crn, sender.accountAddress);
|
||||
return (0, util_1.createTx)(chain, sender, fee, memo, types, msg, msgCosmos);
|
||||
}
|
||||
exports.createTxMsgDeleteName = createTxMsgDeleteName;
|
||||
function createMsgReserveAuthority(name, signer, owner) {
|
||||
return {
|
||||
type: 'nameservice/ReserveAuthority',
|
||||
value: {
|
||||
name,
|
||||
signer,
|
||||
owner
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgReserveAuthority = (name, signer, owner) => {
|
||||
const reserveAuthorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReserveAuthority({
|
||||
name,
|
||||
signer,
|
||||
owner
|
||||
});
|
||||
return {
|
||||
message: reserveAuthorityMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgReserveAuthority',
|
||||
};
|
||||
};
|
||||
function createMsgSetName(crn, cid, signer) {
|
||||
return {
|
||||
type: 'nameservice/SetName',
|
||||
value: {
|
||||
crn,
|
||||
cid,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgSetName = (crn, cid, signer) => {
|
||||
const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetName({
|
||||
crn,
|
||||
cid,
|
||||
signer,
|
||||
});
|
||||
return {
|
||||
message: setNameMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgSetName',
|
||||
};
|
||||
};
|
||||
function createMsgSetRecord(bondId, payload, signer) {
|
||||
return {
|
||||
type: 'nameservice/SetRecord',
|
||||
value: {
|
||||
bond_id: bondId,
|
||||
signer,
|
||||
payload: payload.serialize()
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgSetRecord = (bondId, payloadData, signer) => {
|
||||
const record = new nameservice.vulcanize.nameservice.v1beta1.Record(payloadData.record.serialize());
|
||||
const signatures = payloadData.signatures.map(signature => new nameservice.vulcanize.nameservice.v1beta1.Signature(signature.serialize()));
|
||||
const payload = new nameserviceTx.vulcanize.nameservice.v1beta1.Payload({
|
||||
record,
|
||||
signatures
|
||||
});
|
||||
const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetRecord({
|
||||
bond_id: bondId,
|
||||
signer,
|
||||
payload
|
||||
});
|
||||
return {
|
||||
message: setNameMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgSetRecord',
|
||||
};
|
||||
};
|
||||
function createMsgSetAuthorityBond(name, bondId, signer) {
|
||||
return {
|
||||
type: 'nameservice/SetAuthorityBond',
|
||||
value: {
|
||||
name,
|
||||
bond_id: bondId,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgSetAuthorityBond = (name, bondId, signer) => {
|
||||
const setAuthorityBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetAuthorityBond({
|
||||
name,
|
||||
bond_id: bondId,
|
||||
signer,
|
||||
});
|
||||
return {
|
||||
message: setAuthorityBondMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgSetAuthorityBond',
|
||||
};
|
||||
};
|
||||
function createMsgDeleteName(crn, signer) {
|
||||
return {
|
||||
type: 'nameservice/DeleteAuthority',
|
||||
value: {
|
||||
crn,
|
||||
signer
|
||||
},
|
||||
};
|
||||
}
|
||||
const protoCreateMsgDeleteName = (crn, signer) => {
|
||||
const deleteNameAutorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority({
|
||||
crn,
|
||||
signer,
|
||||
});
|
||||
return {
|
||||
message: deleteNameAutorityMessage,
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority',
|
||||
};
|
||||
};
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
import { Message } from "google-protobuf";
|
||||
import { Chain, Sender, Fee } from '@tharsis/transactions';
|
||||
interface Msg {
|
||||
type: string;
|
||||
value: any;
|
||||
}
|
||||
interface MsgCosmos {
|
||||
message: Message;
|
||||
path: string;
|
||||
}
|
||||
interface Types {
|
||||
[key: string]: Array<{
|
||||
name: string;
|
||||
type: string;
|
||||
}>;
|
||||
}
|
||||
export declare const createTx: (chain: Chain, sender: Sender, fee: Fee, memo: string, messageTypes: Types, msg: Msg, msgCosmos: MsgCosmos) => {
|
||||
signDirect: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
legacyAmino: {
|
||||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody;
|
||||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo;
|
||||
signBytes: string;
|
||||
};
|
||||
eipToSign: {
|
||||
types: object;
|
||||
primaryType: string;
|
||||
domain: {
|
||||
name: string;
|
||||
version: string;
|
||||
chainId: number;
|
||||
verifyingContract: string;
|
||||
salt: string;
|
||||
};
|
||||
message: object;
|
||||
};
|
||||
};
|
||||
export {};
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTx = void 0;
|
||||
const eip712_1 = require("@tharsis/eip712");
|
||||
const proto_1 = require("@tharsis/proto");
|
||||
const createTx = (chain, sender, fee, memo, messageTypes, msg, msgCosmos) => {
|
||||
// EIP712
|
||||
const feeObject = (0, eip712_1.generateFee)(fee.amount, fee.denom, fee.gas, sender.accountAddress);
|
||||
const types = (0, eip712_1.generateTypes)(messageTypes);
|
||||
const messages = (0, eip712_1.generateMessage)(sender.accountNumber.toString(), sender.sequence.toString(), chain.cosmosChainId, memo, feeObject, msg);
|
||||
const eipToSign = (0, eip712_1.createEIP712)(types, chain.chainId, messages);
|
||||
// Cosmos
|
||||
const tx = (0, proto_1.createTransaction)(msgCosmos, memo, fee.amount, fee.denom, parseInt(fee.gas, 10), 'ethsecp256', sender.pubkey, sender.sequence, sender.accountNumber, chain.cosmosChainId);
|
||||
return {
|
||||
signDirect: tx.signDirect,
|
||||
legacyAmino: tx.legacyAmino,
|
||||
eipToSign,
|
||||
};
|
||||
};
|
||||
exports.createTx = createTx;
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: cosmos/base/query/v1beta1/pagination.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace cosmos.base.query.v1beta1 {
|
||||
class PageRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
key?: Uint8Array;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
count_total?: boolean;
|
||||
reverse?: boolean;
|
||||
});
|
||||
get key(): Uint8Array;
|
||||
set key(value: Uint8Array);
|
||||
get offset(): number;
|
||||
set offset(value: number);
|
||||
get limit(): number;
|
||||
set limit(value: number);
|
||||
get count_total(): boolean;
|
||||
set count_total(value: boolean);
|
||||
get reverse(): boolean;
|
||||
set reverse(value: boolean);
|
||||
static fromObject(data: {
|
||||
key?: Uint8Array;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
count_total?: boolean;
|
||||
reverse?: boolean;
|
||||
}): PageRequest;
|
||||
toObject(): {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PageRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): PageRequest;
|
||||
}
|
||||
class PageResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
});
|
||||
get next_key(): Uint8Array;
|
||||
set next_key(value: Uint8Array);
|
||||
get total(): number;
|
||||
set total(value: number);
|
||||
static fromObject(data: {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
}): PageResponse;
|
||||
toObject(): {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PageResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): PageResponse;
|
||||
}
|
||||
}
|
||||
+264
@@ -0,0 +1,264 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cosmos = void 0;
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: cosmos/base/query/v1beta1/pagination.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var cosmos;
|
||||
(function (cosmos) {
|
||||
var base;
|
||||
(function (base) {
|
||||
var query;
|
||||
(function (query) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class PageRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("key" in data && data.key != undefined) {
|
||||
this.key = data.key;
|
||||
}
|
||||
if ("offset" in data && data.offset != undefined) {
|
||||
this.offset = data.offset;
|
||||
}
|
||||
if ("limit" in data && data.limit != undefined) {
|
||||
this.limit = data.limit;
|
||||
}
|
||||
if ("count_total" in data && data.count_total != undefined) {
|
||||
this.count_total = data.count_total;
|
||||
}
|
||||
if ("reverse" in data && data.reverse != undefined) {
|
||||
this.reverse = data.reverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
get key() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set key(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get offset() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set offset(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get limit() {
|
||||
return pb_1.Message.getField(this, 3);
|
||||
}
|
||||
set limit(value) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get count_total() {
|
||||
return pb_1.Message.getField(this, 4);
|
||||
}
|
||||
set count_total(value) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get reverse() {
|
||||
return pb_1.Message.getField(this, 5);
|
||||
}
|
||||
set reverse(value) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new PageRequest({});
|
||||
if (data.key != null) {
|
||||
message.key = data.key;
|
||||
}
|
||||
if (data.offset != null) {
|
||||
message.offset = data.offset;
|
||||
}
|
||||
if (data.limit != null) {
|
||||
message.limit = data.limit;
|
||||
}
|
||||
if (data.count_total != null) {
|
||||
message.count_total = data.count_total;
|
||||
}
|
||||
if (data.reverse != null) {
|
||||
message.reverse = data.reverse;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.key != null) {
|
||||
data.key = this.key;
|
||||
}
|
||||
if (this.offset != null) {
|
||||
data.offset = this.offset;
|
||||
}
|
||||
if (this.limit != null) {
|
||||
data.limit = this.limit;
|
||||
}
|
||||
if (this.count_total != null) {
|
||||
data.count_total = this.count_total;
|
||||
}
|
||||
if (this.reverse != null) {
|
||||
data.reverse = this.reverse;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.key !== undefined)
|
||||
writer.writeBytes(1, this.key);
|
||||
if (this.offset !== undefined)
|
||||
writer.writeUint64(2, this.offset);
|
||||
if (this.limit !== undefined)
|
||||
writer.writeUint64(3, this.limit);
|
||||
if (this.count_total !== undefined)
|
||||
writer.writeBool(4, this.count_total);
|
||||
if (this.reverse !== undefined)
|
||||
writer.writeBool(5, this.reverse);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PageRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.key = reader.readBytes();
|
||||
break;
|
||||
case 2:
|
||||
message.offset = reader.readUint64();
|
||||
break;
|
||||
case 3:
|
||||
message.limit = reader.readUint64();
|
||||
break;
|
||||
case 4:
|
||||
message.count_total = reader.readBool();
|
||||
break;
|
||||
case 5:
|
||||
message.reverse = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return PageRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.PageRequest = PageRequest;
|
||||
class PageResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("next_key" in data && data.next_key != undefined) {
|
||||
this.next_key = data.next_key;
|
||||
}
|
||||
if ("total" in data && data.total != undefined) {
|
||||
this.total = data.total;
|
||||
}
|
||||
}
|
||||
}
|
||||
get next_key() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set next_key(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get total() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set total(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new PageResponse({});
|
||||
if (data.next_key != null) {
|
||||
message.next_key = data.next_key;
|
||||
}
|
||||
if (data.total != null) {
|
||||
message.total = data.total;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.next_key != null) {
|
||||
data.next_key = this.next_key;
|
||||
}
|
||||
if (this.total != null) {
|
||||
data.total = this.total;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.next_key !== undefined)
|
||||
writer.writeBytes(1, this.next_key);
|
||||
if (this.total !== undefined)
|
||||
writer.writeUint64(2, this.total);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PageResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.next_key = reader.readBytes();
|
||||
break;
|
||||
case 2:
|
||||
message.total = reader.readUint64();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return PageResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.PageResponse = PageResponse;
|
||||
})(v1beta1 = query.v1beta1 || (query.v1beta1 = {}));
|
||||
})(query = base.query || (base.query = {}));
|
||||
})(base = cosmos.base || (cosmos.base = {}));
|
||||
})(cosmos = exports.cosmos || (exports.cosmos = {}));
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace cosmos.base.v1beta1 {
|
||||
class Coin extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
});
|
||||
get denom(): string;
|
||||
set denom(value: string);
|
||||
get amount(): string;
|
||||
set amount(value: string);
|
||||
static fromObject(data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}): Coin;
|
||||
toObject(): {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Coin;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Coin;
|
||||
}
|
||||
class DecCoin extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
});
|
||||
get denom(): string;
|
||||
set denom(value: string);
|
||||
get amount(): string;
|
||||
set amount(value: string);
|
||||
static fromObject(data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}): DecCoin;
|
||||
toObject(): {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DecCoin;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): DecCoin;
|
||||
}
|
||||
class IntProto extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
int?: string;
|
||||
});
|
||||
get int(): string;
|
||||
set int(value: string);
|
||||
static fromObject(data: {
|
||||
int?: string;
|
||||
}): IntProto;
|
||||
toObject(): {
|
||||
int?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IntProto;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): IntProto;
|
||||
}
|
||||
class DecProto extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
dec?: string;
|
||||
});
|
||||
get dec(): string;
|
||||
set dec(value: string);
|
||||
static fromObject(data: {
|
||||
dec?: string;
|
||||
}): DecProto;
|
||||
toObject(): {
|
||||
dec?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DecProto;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): DecProto;
|
||||
}
|
||||
}
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cosmos = void 0;
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var cosmos;
|
||||
(function (cosmos) {
|
||||
var base;
|
||||
(function (base) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class Coin extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("denom" in data && data.denom != undefined) {
|
||||
this.denom = data.denom;
|
||||
}
|
||||
if ("amount" in data && data.amount != undefined) {
|
||||
this.amount = data.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get denom() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set denom(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get amount() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set amount(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Coin({});
|
||||
if (data.denom != null) {
|
||||
message.denom = data.denom;
|
||||
}
|
||||
if (data.amount != null) {
|
||||
message.amount = data.amount;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.denom != null) {
|
||||
data.denom = this.denom;
|
||||
}
|
||||
if (this.amount != null) {
|
||||
data.amount = this.amount;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.denom === "string" && this.denom.length)
|
||||
writer.writeString(1, this.denom);
|
||||
if (typeof this.amount === "string" && this.amount.length)
|
||||
writer.writeString(2, this.amount);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Coin();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.denom = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Coin.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Coin = Coin;
|
||||
class DecCoin extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("denom" in data && data.denom != undefined) {
|
||||
this.denom = data.denom;
|
||||
}
|
||||
if ("amount" in data && data.amount != undefined) {
|
||||
this.amount = data.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get denom() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set denom(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get amount() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set amount(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new DecCoin({});
|
||||
if (data.denom != null) {
|
||||
message.denom = data.denom;
|
||||
}
|
||||
if (data.amount != null) {
|
||||
message.amount = data.amount;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.denom != null) {
|
||||
data.denom = this.denom;
|
||||
}
|
||||
if (this.amount != null) {
|
||||
data.amount = this.amount;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.denom === "string" && this.denom.length)
|
||||
writer.writeString(1, this.denom);
|
||||
if (typeof this.amount === "string" && this.amount.length)
|
||||
writer.writeString(2, this.amount);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DecCoin();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.denom = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return DecCoin.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.DecCoin = DecCoin;
|
||||
class IntProto extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("int" in data && data.int != undefined) {
|
||||
this.int = data.int;
|
||||
}
|
||||
}
|
||||
}
|
||||
get int() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set int(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new IntProto({});
|
||||
if (data.int != null) {
|
||||
message.int = data.int;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.int != null) {
|
||||
data.int = this.int;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.int === "string" && this.int.length)
|
||||
writer.writeString(1, this.int);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IntProto();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.int = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return IntProto.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.IntProto = IntProto;
|
||||
class DecProto extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("dec" in data && data.dec != undefined) {
|
||||
this.dec = data.dec;
|
||||
}
|
||||
}
|
||||
}
|
||||
get dec() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set dec(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new DecProto({});
|
||||
if (data.dec != null) {
|
||||
message.dec = data.dec;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.dec != null) {
|
||||
data.dec = this.dec;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.dec === "string" && this.dec.length)
|
||||
writer.writeString(1, this.dec);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DecProto();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.dec = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return DecProto.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.DecProto = DecProto;
|
||||
})(v1beta1 = base.v1beta1 || (base.v1beta1 = {}));
|
||||
})(base = cosmos.base || (cosmos.base = {}));
|
||||
})(cosmos = exports.cosmos || (exports.cosmos = {}));
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
export declare namespace gogoproto { }
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare namespace google.api { }
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
Vendored
+185
@@ -0,0 +1,185 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: google/api/http.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace google.api {
|
||||
class Http extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
rules?: HttpRule[];
|
||||
fully_decode_reserved_expansion?: boolean;
|
||||
});
|
||||
get rules(): HttpRule[];
|
||||
set rules(value: HttpRule[]);
|
||||
get fully_decode_reserved_expansion(): boolean;
|
||||
set fully_decode_reserved_expansion(value: boolean);
|
||||
static fromObject(data: {
|
||||
rules?: ReturnType<typeof HttpRule.prototype.toObject>[];
|
||||
fully_decode_reserved_expansion?: boolean;
|
||||
}): Http;
|
||||
toObject(): {
|
||||
rules?: {
|
||||
selector?: string | undefined;
|
||||
get?: string | undefined;
|
||||
put?: string | undefined;
|
||||
post?: string | undefined;
|
||||
delete?: string | undefined;
|
||||
patch?: string | undefined;
|
||||
custom?: {
|
||||
kind?: string | undefined;
|
||||
path?: string | undefined;
|
||||
} | undefined;
|
||||
body?: string | undefined;
|
||||
response_body?: string | undefined;
|
||||
additional_bindings?: any[] | undefined;
|
||||
}[] | undefined;
|
||||
fully_decode_reserved_expansion?: boolean | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Http;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Http;
|
||||
}
|
||||
class HttpRule extends pb_1.Message {
|
||||
constructor(data?: any[] | ({
|
||||
selector?: string;
|
||||
body?: string;
|
||||
response_body?: string;
|
||||
additional_bindings?: HttpRule[];
|
||||
} & (({
|
||||
get?: string;
|
||||
put?: never;
|
||||
post?: never;
|
||||
delete?: never;
|
||||
patch?: never;
|
||||
custom?: never;
|
||||
} | {
|
||||
get?: never;
|
||||
put?: string;
|
||||
post?: never;
|
||||
delete?: never;
|
||||
patch?: never;
|
||||
custom?: never;
|
||||
} | {
|
||||
get?: never;
|
||||
put?: never;
|
||||
post?: string;
|
||||
delete?: never;
|
||||
patch?: never;
|
||||
custom?: never;
|
||||
} | {
|
||||
get?: never;
|
||||
put?: never;
|
||||
post?: never;
|
||||
delete?: string;
|
||||
patch?: never;
|
||||
custom?: never;
|
||||
} | {
|
||||
get?: never;
|
||||
put?: never;
|
||||
post?: never;
|
||||
delete?: never;
|
||||
patch?: string;
|
||||
custom?: never;
|
||||
} | {
|
||||
get?: never;
|
||||
put?: never;
|
||||
post?: never;
|
||||
delete?: never;
|
||||
patch?: never;
|
||||
custom?: CustomHttpPattern;
|
||||
}))));
|
||||
get selector(): string;
|
||||
set selector(value: string);
|
||||
get get(): string;
|
||||
set get(value: string);
|
||||
get put(): string;
|
||||
set put(value: string);
|
||||
get post(): string;
|
||||
set post(value: string);
|
||||
get delete(): string;
|
||||
set delete(value: string);
|
||||
get patch(): string;
|
||||
set patch(value: string);
|
||||
get custom(): CustomHttpPattern;
|
||||
set custom(value: CustomHttpPattern);
|
||||
get body(): string;
|
||||
set body(value: string);
|
||||
get response_body(): string;
|
||||
set response_body(value: string);
|
||||
get additional_bindings(): HttpRule[];
|
||||
set additional_bindings(value: HttpRule[]);
|
||||
get pattern(): "patch" | "get" | "put" | "post" | "delete" | "custom" | "none";
|
||||
static fromObject(data: {
|
||||
selector?: string;
|
||||
get?: string;
|
||||
put?: string;
|
||||
post?: string;
|
||||
delete?: string;
|
||||
patch?: string;
|
||||
custom?: ReturnType<typeof CustomHttpPattern.prototype.toObject>;
|
||||
body?: string;
|
||||
response_body?: string;
|
||||
additional_bindings?: ReturnType<typeof HttpRule.prototype.toObject>[];
|
||||
}): HttpRule;
|
||||
toObject(): {
|
||||
selector?: string | undefined;
|
||||
get?: string | undefined;
|
||||
put?: string | undefined;
|
||||
post?: string | undefined;
|
||||
delete?: string | undefined;
|
||||
patch?: string | undefined;
|
||||
custom?: {
|
||||
kind?: string | undefined;
|
||||
path?: string | undefined;
|
||||
} | undefined;
|
||||
body?: string | undefined;
|
||||
response_body?: string | undefined;
|
||||
additional_bindings?: {
|
||||
selector?: string | undefined;
|
||||
get?: string | undefined;
|
||||
put?: string | undefined;
|
||||
post?: string | undefined;
|
||||
delete?: string | undefined;
|
||||
patch?: string | undefined;
|
||||
custom?: {
|
||||
kind?: string | undefined;
|
||||
path?: string | undefined;
|
||||
} | undefined;
|
||||
body?: string | undefined;
|
||||
response_body?: string | undefined;
|
||||
additional_bindings?: any[] | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): HttpRule;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): HttpRule;
|
||||
}
|
||||
class CustomHttpPattern extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
kind?: string;
|
||||
path?: string;
|
||||
});
|
||||
get kind(): string;
|
||||
set kind(value: string);
|
||||
get path(): string;
|
||||
set path(value: string);
|
||||
static fromObject(data: {
|
||||
kind?: string;
|
||||
path?: string;
|
||||
}): CustomHttpPattern;
|
||||
toObject(): {
|
||||
kind?: string | undefined;
|
||||
path?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CustomHttpPattern;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): CustomHttpPattern;
|
||||
}
|
||||
}
|
||||
Vendored
+449
@@ -0,0 +1,449 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.google = void 0;
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: google/api/http.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var google;
|
||||
(function (google) {
|
||||
var api;
|
||||
(function (api) {
|
||||
class Http extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("rules" in data && data.rules != undefined) {
|
||||
this.rules = data.rules;
|
||||
}
|
||||
if ("fully_decode_reserved_expansion" in data && data.fully_decode_reserved_expansion != undefined) {
|
||||
this.fully_decode_reserved_expansion = data.fully_decode_reserved_expansion;
|
||||
}
|
||||
}
|
||||
}
|
||||
get rules() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, HttpRule, 1);
|
||||
}
|
||||
set rules(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
get fully_decode_reserved_expansion() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set fully_decode_reserved_expansion(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Http({});
|
||||
if (data.rules != null) {
|
||||
message.rules = data.rules.map(item => HttpRule.fromObject(item));
|
||||
}
|
||||
if (data.fully_decode_reserved_expansion != null) {
|
||||
message.fully_decode_reserved_expansion = data.fully_decode_reserved_expansion;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.rules != null) {
|
||||
data.rules = this.rules.map((item) => item.toObject());
|
||||
}
|
||||
if (this.fully_decode_reserved_expansion != null) {
|
||||
data.fully_decode_reserved_expansion = this.fully_decode_reserved_expansion;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.rules !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.rules, (item) => item.serialize(writer));
|
||||
if (this.fully_decode_reserved_expansion !== undefined)
|
||||
writer.writeBool(2, this.fully_decode_reserved_expansion);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Http();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.rules, () => pb_1.Message.addToRepeatedWrapperField(message, 1, HttpRule.deserialize(reader), HttpRule));
|
||||
break;
|
||||
case 2:
|
||||
message.fully_decode_reserved_expansion = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Http.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
api.Http = Http;
|
||||
class HttpRule extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], [[2, 3, 4, 5, 6, 8]]);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("selector" in data && data.selector != undefined) {
|
||||
this.selector = data.selector;
|
||||
}
|
||||
if ("get" in data && data.get != undefined) {
|
||||
this.get = data.get;
|
||||
}
|
||||
if ("put" in data && data.put != undefined) {
|
||||
this.put = data.put;
|
||||
}
|
||||
if ("post" in data && data.post != undefined) {
|
||||
this.post = data.post;
|
||||
}
|
||||
if ("delete" in data && data.delete != undefined) {
|
||||
this.delete = data.delete;
|
||||
}
|
||||
if ("patch" in data && data.patch != undefined) {
|
||||
this.patch = data.patch;
|
||||
}
|
||||
if ("custom" in data && data.custom != undefined) {
|
||||
this.custom = data.custom;
|
||||
}
|
||||
if ("body" in data && data.body != undefined) {
|
||||
this.body = data.body;
|
||||
}
|
||||
if ("response_body" in data && data.response_body != undefined) {
|
||||
this.response_body = data.response_body;
|
||||
}
|
||||
if ("additional_bindings" in data && data.additional_bindings != undefined) {
|
||||
this.additional_bindings = data.additional_bindings;
|
||||
}
|
||||
}
|
||||
}
|
||||
get selector() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set selector(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get get() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set get(value) {
|
||||
pb_1.Message.setOneofField(this, 2, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get put() {
|
||||
return pb_1.Message.getField(this, 3);
|
||||
}
|
||||
set put(value) {
|
||||
pb_1.Message.setOneofField(this, 3, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get post() {
|
||||
return pb_1.Message.getField(this, 4);
|
||||
}
|
||||
set post(value) {
|
||||
pb_1.Message.setOneofField(this, 4, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get delete() {
|
||||
return pb_1.Message.getField(this, 5);
|
||||
}
|
||||
set delete(value) {
|
||||
pb_1.Message.setOneofField(this, 5, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get patch() {
|
||||
return pb_1.Message.getField(this, 6);
|
||||
}
|
||||
set patch(value) {
|
||||
pb_1.Message.setOneofField(this, 6, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get custom() {
|
||||
return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8);
|
||||
}
|
||||
set custom(value) {
|
||||
pb_1.Message.setOneofWrapperField(this, 8, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get body() {
|
||||
return pb_1.Message.getField(this, 7);
|
||||
}
|
||||
set body(value) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
get response_body() {
|
||||
return pb_1.Message.getField(this, 12);
|
||||
}
|
||||
set response_body(value) {
|
||||
pb_1.Message.setField(this, 12, value);
|
||||
}
|
||||
get additional_bindings() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, HttpRule, 11);
|
||||
}
|
||||
set additional_bindings(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 11, value);
|
||||
}
|
||||
get pattern() {
|
||||
const cases = {
|
||||
0: "none",
|
||||
2: "get",
|
||||
3: "put",
|
||||
4: "post",
|
||||
5: "delete",
|
||||
6: "patch",
|
||||
8: "custom"
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [2, 3, 4, 5, 6, 8])];
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new HttpRule({});
|
||||
if (data.selector != null) {
|
||||
message.selector = data.selector;
|
||||
}
|
||||
if (data.get != null) {
|
||||
message.get = data.get;
|
||||
}
|
||||
if (data.put != null) {
|
||||
message.put = data.put;
|
||||
}
|
||||
if (data.post != null) {
|
||||
message.post = data.post;
|
||||
}
|
||||
if (data.delete != null) {
|
||||
message.delete = data.delete;
|
||||
}
|
||||
if (data.patch != null) {
|
||||
message.patch = data.patch;
|
||||
}
|
||||
if (data.custom != null) {
|
||||
message.custom = CustomHttpPattern.fromObject(data.custom);
|
||||
}
|
||||
if (data.body != null) {
|
||||
message.body = data.body;
|
||||
}
|
||||
if (data.response_body != null) {
|
||||
message.response_body = data.response_body;
|
||||
}
|
||||
if (data.additional_bindings != null) {
|
||||
message.additional_bindings = data.additional_bindings.map(item => HttpRule.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.selector != null) {
|
||||
data.selector = this.selector;
|
||||
}
|
||||
if (this.get != null) {
|
||||
data.get = this.get;
|
||||
}
|
||||
if (this.put != null) {
|
||||
data.put = this.put;
|
||||
}
|
||||
if (this.post != null) {
|
||||
data.post = this.post;
|
||||
}
|
||||
if (this.delete != null) {
|
||||
data.delete = this.delete;
|
||||
}
|
||||
if (this.patch != null) {
|
||||
data.patch = this.patch;
|
||||
}
|
||||
if (this.custom != null) {
|
||||
data.custom = this.custom.toObject();
|
||||
}
|
||||
if (this.body != null) {
|
||||
data.body = this.body;
|
||||
}
|
||||
if (this.response_body != null) {
|
||||
data.response_body = this.response_body;
|
||||
}
|
||||
if (this.additional_bindings != null) {
|
||||
data.additional_bindings = this.additional_bindings.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.selector === "string" && this.selector.length)
|
||||
writer.writeString(1, this.selector);
|
||||
if (typeof this.get === "string" && this.get.length)
|
||||
writer.writeString(2, this.get);
|
||||
if (typeof this.put === "string" && this.put.length)
|
||||
writer.writeString(3, this.put);
|
||||
if (typeof this.post === "string" && this.post.length)
|
||||
writer.writeString(4, this.post);
|
||||
if (typeof this.delete === "string" && this.delete.length)
|
||||
writer.writeString(5, this.delete);
|
||||
if (typeof this.patch === "string" && this.patch.length)
|
||||
writer.writeString(6, this.patch);
|
||||
if (this.custom !== undefined)
|
||||
writer.writeMessage(8, this.custom, () => this.custom.serialize(writer));
|
||||
if (typeof this.body === "string" && this.body.length)
|
||||
writer.writeString(7, this.body);
|
||||
if (typeof this.response_body === "string" && this.response_body.length)
|
||||
writer.writeString(12, this.response_body);
|
||||
if (this.additional_bindings !== undefined)
|
||||
writer.writeRepeatedMessage(11, this.additional_bindings, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new HttpRule();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.selector = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.get = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.put = reader.readString();
|
||||
break;
|
||||
case 4:
|
||||
message.post = reader.readString();
|
||||
break;
|
||||
case 5:
|
||||
message.delete = reader.readString();
|
||||
break;
|
||||
case 6:
|
||||
message.patch = reader.readString();
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.custom, () => message.custom = CustomHttpPattern.deserialize(reader));
|
||||
break;
|
||||
case 7:
|
||||
message.body = reader.readString();
|
||||
break;
|
||||
case 12:
|
||||
message.response_body = reader.readString();
|
||||
break;
|
||||
case 11:
|
||||
reader.readMessage(message.additional_bindings, () => pb_1.Message.addToRepeatedWrapperField(message, 11, HttpRule.deserialize(reader), HttpRule));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return HttpRule.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
api.HttpRule = HttpRule;
|
||||
class CustomHttpPattern extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("kind" in data && data.kind != undefined) {
|
||||
this.kind = data.kind;
|
||||
}
|
||||
if ("path" in data && data.path != undefined) {
|
||||
this.path = data.path;
|
||||
}
|
||||
}
|
||||
}
|
||||
get kind() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set kind(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get path() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set path(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new CustomHttpPattern({});
|
||||
if (data.kind != null) {
|
||||
message.kind = data.kind;
|
||||
}
|
||||
if (data.path != null) {
|
||||
message.path = data.path;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.kind != null) {
|
||||
data.kind = this.kind;
|
||||
}
|
||||
if (this.path != null) {
|
||||
data.path = this.path;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.kind === "string" && this.kind.length)
|
||||
writer.writeString(1, this.kind);
|
||||
if (typeof this.path === "string" && this.path.length)
|
||||
writer.writeString(2, this.path);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CustomHttpPattern();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.kind = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.path = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return CustomHttpPattern.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
api.CustomHttpPattern = CustomHttpPattern;
|
||||
})(api = google.api || (google.api = {}));
|
||||
})(google = exports.google || (exports.google = {}));
|
||||
+1211
File diff suppressed because it is too large
Load Diff
+3476
File diff suppressed because it is too large
Load Diff
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: google/protobuf/duration.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace google.protobuf {
|
||||
class Duration extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
});
|
||||
get seconds(): number;
|
||||
set seconds(value: number);
|
||||
get nanos(): number;
|
||||
set nanos(value: number);
|
||||
static fromObject(data: {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
}): Duration;
|
||||
toObject(): {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Duration;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Duration;
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.google = void 0;
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: google/protobuf/duration.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var google;
|
||||
(function (google) {
|
||||
var protobuf;
|
||||
(function (protobuf) {
|
||||
class Duration extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("seconds" in data && data.seconds != undefined) {
|
||||
this.seconds = data.seconds;
|
||||
}
|
||||
if ("nanos" in data && data.nanos != undefined) {
|
||||
this.nanos = data.nanos;
|
||||
}
|
||||
}
|
||||
}
|
||||
get seconds() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set seconds(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get nanos() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set nanos(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Duration({});
|
||||
if (data.seconds != null) {
|
||||
message.seconds = data.seconds;
|
||||
}
|
||||
if (data.nanos != null) {
|
||||
message.nanos = data.nanos;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.seconds != null) {
|
||||
data.seconds = this.seconds;
|
||||
}
|
||||
if (this.nanos != null) {
|
||||
data.nanos = this.nanos;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.seconds !== undefined)
|
||||
writer.writeInt64(1, this.seconds);
|
||||
if (this.nanos !== undefined)
|
||||
writer.writeInt32(2, this.nanos);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Duration();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.seconds = reader.readInt64();
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Duration.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
protobuf.Duration = Duration;
|
||||
})(protobuf = google.protobuf || (google.protobuf = {}));
|
||||
})(google = exports.google || (exports.google = {}));
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: google/protobuf/timestamp.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace google.protobuf {
|
||||
class Timestamp extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
});
|
||||
get seconds(): number;
|
||||
set seconds(value: number);
|
||||
get nanos(): number;
|
||||
set nanos(value: number);
|
||||
static fromObject(data: {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
}): Timestamp;
|
||||
toObject(): {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Timestamp;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Timestamp;
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.google = void 0;
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: google/protobuf/timestamp.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var google;
|
||||
(function (google) {
|
||||
var protobuf;
|
||||
(function (protobuf) {
|
||||
class Timestamp extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("seconds" in data && data.seconds != undefined) {
|
||||
this.seconds = data.seconds;
|
||||
}
|
||||
if ("nanos" in data && data.nanos != undefined) {
|
||||
this.nanos = data.nanos;
|
||||
}
|
||||
}
|
||||
}
|
||||
get seconds() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set seconds(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get nanos() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set nanos(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Timestamp({});
|
||||
if (data.seconds != null) {
|
||||
message.seconds = data.seconds;
|
||||
}
|
||||
if (data.nanos != null) {
|
||||
message.nanos = data.nanos;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.seconds != null) {
|
||||
data.seconds = this.seconds;
|
||||
}
|
||||
if (this.nanos != null) {
|
||||
data.nanos = this.nanos;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.seconds !== undefined)
|
||||
writer.writeInt64(1, this.seconds);
|
||||
if (this.nanos !== undefined)
|
||||
writer.writeInt32(2, this.nanos);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Timestamp();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.seconds = reader.readInt64();
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Timestamp.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
protobuf.Timestamp = Timestamp;
|
||||
})(protobuf = google.protobuf || (google.protobuf = {}));
|
||||
})(google = exports.google || (exports.google = {}));
|
||||
@@ -0,0 +1,85 @@
|
||||
import * as dependency_2 from "./types";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.auction.v1beta1 {
|
||||
class GenesisState extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.auction.v1beta1.Params;
|
||||
auctions?: dependency_2.vulcanize.auction.v1beta1.Auction[];
|
||||
});
|
||||
get params(): dependency_2.vulcanize.auction.v1beta1.Params;
|
||||
set params(value: dependency_2.vulcanize.auction.v1beta1.Params);
|
||||
get auctions(): dependency_2.vulcanize.auction.v1beta1.Auction[];
|
||||
set auctions(value: dependency_2.vulcanize.auction.v1beta1.Auction[]);
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Params.prototype.toObject>;
|
||||
auctions?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Auction.prototype.toObject>[];
|
||||
}): GenesisState;
|
||||
toObject(): {
|
||||
params?: {
|
||||
commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
auctions?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): GenesisState;
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./types"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var auction;
|
||||
(function (auction) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class GenesisState extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Params, 1);
|
||||
}
|
||||
set params(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Auction, 2);
|
||||
}
|
||||
set auctions(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new GenesisState({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.auction.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
if (data.auctions != null) {
|
||||
message.auctions = data.auctions.map(item => dependency_2.vulcanize.auction.v1beta1.Auction.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.params !== undefined)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (this.auctions !== undefined)
|
||||
writer.writeRepeatedMessage(2, this.auctions, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.auction.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.auctions, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.auction.v1beta1.Auction.deserialize(reader), dependency_2.vulcanize.auction.v1beta1.Auction));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return GenesisState.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.GenesisState = GenesisState;
|
||||
})(v1beta1 = auction.v1beta1 || (auction.v1beta1 = {}));
|
||||
})(auction = vulcanize.auction || (vulcanize.auction = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+528
@@ -0,0 +1,528 @@
|
||||
import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination";
|
||||
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as dependency_5 from "./types";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.auction.v1beta1 {
|
||||
class AuctionsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): AuctionsRequest;
|
||||
toObject(): {
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionsRequest;
|
||||
}
|
||||
class AuctionsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions;
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get auctions(): dependency_5.vulcanize.auction.v1beta1.Auctions;
|
||||
set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>;
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): AuctionsResponse;
|
||||
toObject(): {
|
||||
auctions?: {
|
||||
auctions?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionsResponse;
|
||||
}
|
||||
class AuctionRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): AuctionRequest;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionRequest;
|
||||
}
|
||||
class AuctionResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction?: dependency_5.vulcanize.auction.v1beta1.Auction;
|
||||
});
|
||||
get auction(): dependency_5.vulcanize.auction.v1beta1.Auction;
|
||||
set auction(value: dependency_5.vulcanize.auction.v1beta1.Auction);
|
||||
static fromObject(data: {
|
||||
auction?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
}): AuctionResponse;
|
||||
toObject(): {
|
||||
auction?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionResponse;
|
||||
}
|
||||
class BidRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
bidder?: string;
|
||||
});
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
get bidder(): string;
|
||||
set bidder(value: string);
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
bidder?: string;
|
||||
}): BidRequest;
|
||||
toObject(): {
|
||||
auction_id?: string | undefined;
|
||||
bidder?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BidRequest;
|
||||
}
|
||||
class BidResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bid?: dependency_5.vulcanize.auction.v1beta1.Bid;
|
||||
});
|
||||
get bid(): dependency_5.vulcanize.auction.v1beta1.Bid;
|
||||
set bid(value: dependency_5.vulcanize.auction.v1beta1.Bid);
|
||||
static fromObject(data: {
|
||||
bid?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Bid.prototype.toObject>;
|
||||
}): BidResponse;
|
||||
toObject(): {
|
||||
bid?: {
|
||||
auction_id?: string | undefined;
|
||||
bidder_address?: string | undefined;
|
||||
status?: string | undefined;
|
||||
commit_hash?: string | undefined;
|
||||
commit_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
bid_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BidResponse;
|
||||
}
|
||||
class BidsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
});
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
}): BidsRequest;
|
||||
toObject(): {
|
||||
auction_id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BidsRequest;
|
||||
}
|
||||
class BidsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bids?: dependency_5.vulcanize.auction.v1beta1.Bid[];
|
||||
});
|
||||
get bids(): dependency_5.vulcanize.auction.v1beta1.Bid[];
|
||||
set bids(value: dependency_5.vulcanize.auction.v1beta1.Bid[]);
|
||||
static fromObject(data: {
|
||||
bids?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Bid.prototype.toObject>[];
|
||||
}): BidsResponse;
|
||||
toObject(): {
|
||||
bids?: {
|
||||
auction_id?: string | undefined;
|
||||
bidder_address?: string | undefined;
|
||||
status?: string | undefined;
|
||||
commit_hash?: string | undefined;
|
||||
commit_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
bid_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BidsResponse;
|
||||
}
|
||||
class AuctionsByBidderRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bidder_address?: string;
|
||||
});
|
||||
get bidder_address(): string;
|
||||
set bidder_address(value: string);
|
||||
static fromObject(data: {
|
||||
bidder_address?: string;
|
||||
}): AuctionsByBidderRequest;
|
||||
toObject(): {
|
||||
bidder_address?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByBidderRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionsByBidderRequest;
|
||||
}
|
||||
class AuctionsByBidderResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions;
|
||||
});
|
||||
get auctions(): dependency_5.vulcanize.auction.v1beta1.Auctions;
|
||||
set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions);
|
||||
static fromObject(data: {
|
||||
auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>;
|
||||
}): AuctionsByBidderResponse;
|
||||
toObject(): {
|
||||
auctions?: {
|
||||
auctions?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByBidderResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionsByBidderResponse;
|
||||
}
|
||||
class AuctionsByOwnerRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
owner_address?: string;
|
||||
});
|
||||
get owner_address(): string;
|
||||
set owner_address(value: string);
|
||||
static fromObject(data: {
|
||||
owner_address?: string;
|
||||
}): AuctionsByOwnerRequest;
|
||||
toObject(): {
|
||||
owner_address?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByOwnerRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionsByOwnerRequest;
|
||||
}
|
||||
class AuctionsByOwnerResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions;
|
||||
});
|
||||
get auctions(): dependency_5.vulcanize.auction.v1beta1.Auctions;
|
||||
set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions);
|
||||
static fromObject(data: {
|
||||
auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>;
|
||||
}): AuctionsByOwnerResponse;
|
||||
toObject(): {
|
||||
auctions?: {
|
||||
auctions?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByOwnerResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionsByOwnerResponse;
|
||||
}
|
||||
class QueryParamsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): QueryParamsRequest;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsRequest;
|
||||
}
|
||||
class QueryParamsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_5.vulcanize.auction.v1beta1.Params;
|
||||
});
|
||||
get params(): dependency_5.vulcanize.auction.v1beta1.Params;
|
||||
set params(value: dependency_5.vulcanize.auction.v1beta1.Params);
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Params.prototype.toObject>;
|
||||
}): QueryParamsResponse;
|
||||
toObject(): {
|
||||
params?: {
|
||||
commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsResponse;
|
||||
}
|
||||
class BalanceRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): BalanceRequest;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BalanceRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BalanceRequest;
|
||||
}
|
||||
class BalanceResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
balance?: dependency_4.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get balance(): dependency_4.cosmos.base.v1beta1.Coin[];
|
||||
set balance(value: dependency_4.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
balance?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): BalanceResponse;
|
||||
toObject(): {
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BalanceResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BalanceResponse;
|
||||
}
|
||||
}
|
||||
+981
@@ -0,0 +1,981 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_3 = __importStar(require("./../../../cosmos/base/query/v1beta1/pagination"));
|
||||
const dependency_4 = __importStar(require("./../../../cosmos/base/v1beta1/coin"));
|
||||
const dependency_5 = __importStar(require("./types"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var auction;
|
||||
(function (auction) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class AuctionsRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 1);
|
||||
}
|
||||
set pagination(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionsRequest({});
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.pagination !== undefined)
|
||||
writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionsRequest = AuctionsRequest;
|
||||
class AuctionsResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1);
|
||||
}
|
||||
set auctions(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2);
|
||||
}
|
||||
set pagination(value) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionsResponse({});
|
||||
if (data.auctions != null) {
|
||||
message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions);
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.toObject();
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auctions !== undefined)
|
||||
writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer));
|
||||
if (this.pagination !== undefined)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionsResponse = AuctionsResponse;
|
||||
class AuctionRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionRequest({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionRequest = AuctionRequest;
|
||||
class AuctionResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction" in data && data.auction != undefined) {
|
||||
this.auction = data.auction;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auction, 1);
|
||||
}
|
||||
set auction(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionResponse({});
|
||||
if (data.auction != null) {
|
||||
message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction != null) {
|
||||
data.auction = this.auction.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auction !== undefined)
|
||||
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auction, () => message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionResponse = AuctionResponse;
|
||||
class BidRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("bidder" in data && data.bidder != undefined) {
|
||||
this.bidder = data.bidder;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set auction_id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get bidder() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set bidder(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new BidRequest({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.bidder != null) {
|
||||
message.bidder = data.bidder;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.bidder != null) {
|
||||
data.bidder = this.bidder;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.auction_id === "string" && this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (typeof this.bidder === "string" && this.bidder.length)
|
||||
writer.writeString(2, this.bidder);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.bidder = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return BidRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.BidRequest = BidRequest;
|
||||
class BidResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bid" in data && data.bid != undefined) {
|
||||
this.bid = data.bid;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Bid, 1);
|
||||
}
|
||||
set bid(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new BidResponse({});
|
||||
if (data.bid != null) {
|
||||
message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(data.bid);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bid != null) {
|
||||
data.bid = this.bid.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bid !== undefined)
|
||||
writer.writeMessage(1, this.bid, () => this.bid.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bid, () => message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return BidResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.BidResponse = BidResponse;
|
||||
class BidsRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set auction_id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new BidsRequest({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.auction_id === "string" && this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return BidsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.BidsRequest = BidsRequest;
|
||||
class BidsResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bids" in data && data.bids != undefined) {
|
||||
this.bids = data.bids;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bids() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Bid, 1);
|
||||
}
|
||||
set bids(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new BidsResponse({});
|
||||
if (data.bids != null) {
|
||||
message.bids = data.bids.map(item => dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bids != null) {
|
||||
data.bids = this.bids.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bids !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.bids, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bids, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_5.vulcanize.auction.v1beta1.Bid.deserialize(reader), dependency_5.vulcanize.auction.v1beta1.Bid));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return BidsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.BidsResponse = BidsResponse;
|
||||
class AuctionsByBidderRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bidder_address" in data && data.bidder_address != undefined) {
|
||||
this.bidder_address = data.bidder_address;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bidder_address() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set bidder_address(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionsByBidderRequest({});
|
||||
if (data.bidder_address != null) {
|
||||
message.bidder_address = data.bidder_address;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bidder_address != null) {
|
||||
data.bidder_address = this.bidder_address;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.bidder_address === "string" && this.bidder_address.length)
|
||||
writer.writeString(1, this.bidder_address);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByBidderRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.bidder_address = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionsByBidderRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionsByBidderRequest = AuctionsByBidderRequest;
|
||||
class AuctionsByBidderResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1);
|
||||
}
|
||||
set auctions(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionsByBidderResponse({});
|
||||
if (data.auctions != null) {
|
||||
message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auctions !== undefined)
|
||||
writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByBidderResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionsByBidderResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionsByBidderResponse = AuctionsByBidderResponse;
|
||||
class AuctionsByOwnerRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("owner_address" in data && data.owner_address != undefined) {
|
||||
this.owner_address = data.owner_address;
|
||||
}
|
||||
}
|
||||
}
|
||||
get owner_address() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set owner_address(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionsByOwnerRequest({});
|
||||
if (data.owner_address != null) {
|
||||
message.owner_address = data.owner_address;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.owner_address != null) {
|
||||
data.owner_address = this.owner_address;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.owner_address === "string" && this.owner_address.length)
|
||||
writer.writeString(1, this.owner_address);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByOwnerRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.owner_address = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionsByOwnerRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionsByOwnerRequest = AuctionsByOwnerRequest;
|
||||
class AuctionsByOwnerResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1);
|
||||
}
|
||||
set auctions(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new AuctionsByOwnerResponse({});
|
||||
if (data.auctions != null) {
|
||||
message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auctions !== undefined)
|
||||
writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByOwnerResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return AuctionsByOwnerResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.AuctionsByOwnerResponse = AuctionsByOwnerResponse;
|
||||
class QueryParamsRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryParamsRequest({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryParamsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryParamsRequest = QueryParamsRequest;
|
||||
class QueryParamsResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Params, 1);
|
||||
}
|
||||
set params(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryParamsResponse({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_5.vulcanize.auction.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.params !== undefined)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_5.vulcanize.auction.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryParamsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryParamsResponse = QueryParamsResponse;
|
||||
class BalanceRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new BalanceRequest({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BalanceRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return BalanceRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.BalanceRequest = BalanceRequest;
|
||||
class BalanceResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("balance" in data && data.balance != undefined) {
|
||||
this.balance = data.balance;
|
||||
}
|
||||
}
|
||||
}
|
||||
get balance() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 1);
|
||||
}
|
||||
set balance(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new BalanceResponse({});
|
||||
if (data.balance != null) {
|
||||
message.balance = data.balance.map(item => dependency_4.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.balance != null) {
|
||||
data.balance = this.balance.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.balance !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.balance, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BalanceResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_4.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return BalanceResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.BalanceResponse = BalanceResponse;
|
||||
})(v1beta1 = auction.v1beta1 || (auction.v1beta1 = {}));
|
||||
})(auction = vulcanize.auction || (vulcanize.auction = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
import * as dependency_2 from "./../../../google/protobuf/duration";
|
||||
import * as dependency_3 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as dependency_4 from "./types";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.auction.v1beta1 {
|
||||
class MsgCreateAuction extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
commits_duration?: dependency_2.google.protobuf.Duration;
|
||||
reveals_duration?: dependency_2.google.protobuf.Duration;
|
||||
commit_fee?: dependency_3.cosmos.base.v1beta1.Coin;
|
||||
reveal_fee?: dependency_3.cosmos.base.v1beta1.Coin;
|
||||
minimum_bid?: dependency_3.cosmos.base.v1beta1.Coin;
|
||||
signer?: string;
|
||||
});
|
||||
get commits_duration(): dependency_2.google.protobuf.Duration;
|
||||
set commits_duration(value: dependency_2.google.protobuf.Duration);
|
||||
get reveals_duration(): dependency_2.google.protobuf.Duration;
|
||||
set reveals_duration(value: dependency_2.google.protobuf.Duration);
|
||||
get commit_fee(): dependency_3.cosmos.base.v1beta1.Coin;
|
||||
set commit_fee(value: dependency_3.cosmos.base.v1beta1.Coin);
|
||||
get reveal_fee(): dependency_3.cosmos.base.v1beta1.Coin;
|
||||
set reveal_fee(value: dependency_3.cosmos.base.v1beta1.Coin);
|
||||
get minimum_bid(): dependency_3.cosmos.base.v1beta1.Coin;
|
||||
set minimum_bid(value: dependency_3.cosmos.base.v1beta1.Coin);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
commits_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>;
|
||||
reveals_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>;
|
||||
commit_fee?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
reveal_fee?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
minimum_bid?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
signer?: string;
|
||||
}): MsgCreateAuction;
|
||||
toObject(): {
|
||||
commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateAuction;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateAuction;
|
||||
}
|
||||
class MsgCreateAuctionResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction?: dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
});
|
||||
get auction(): dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction);
|
||||
static fromObject(data: {
|
||||
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
}): MsgCreateAuctionResponse;
|
||||
toObject(): {
|
||||
auction?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateAuctionResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateAuctionResponse;
|
||||
}
|
||||
class MsgCommitBid extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
commit_hash?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
get commit_hash(): string;
|
||||
set commit_hash(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
commit_hash?: string;
|
||||
signer?: string;
|
||||
}): MsgCommitBid;
|
||||
toObject(): {
|
||||
auction_id?: string | undefined;
|
||||
commit_hash?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCommitBid;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCommitBid;
|
||||
}
|
||||
class MsgRevealBid extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
reveal?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
get reveal(): string;
|
||||
set reveal(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
reveal?: string;
|
||||
signer?: string;
|
||||
}): MsgRevealBid;
|
||||
toObject(): {
|
||||
auction_id?: string | undefined;
|
||||
reveal?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRevealBid;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRevealBid;
|
||||
}
|
||||
class MsgCommitBidResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bid?: dependency_4.vulcanize.auction.v1beta1.Bid;
|
||||
});
|
||||
get bid(): dependency_4.vulcanize.auction.v1beta1.Bid;
|
||||
set bid(value: dependency_4.vulcanize.auction.v1beta1.Bid);
|
||||
static fromObject(data: {
|
||||
bid?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Bid.prototype.toObject>;
|
||||
}): MsgCommitBidResponse;
|
||||
toObject(): {
|
||||
bid?: {
|
||||
auction_id?: string | undefined;
|
||||
bidder_address?: string | undefined;
|
||||
status?: string | undefined;
|
||||
commit_hash?: string | undefined;
|
||||
commit_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
bid_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCommitBidResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCommitBidResponse;
|
||||
}
|
||||
class MsgRevealBidResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction?: dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
});
|
||||
get auction(): dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction);
|
||||
static fromObject(data: {
|
||||
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
}): MsgRevealBidResponse;
|
||||
toObject(): {
|
||||
auction?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRevealBidResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRevealBidResponse;
|
||||
}
|
||||
}
|
||||
+573
@@ -0,0 +1,573 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./../../../google/protobuf/duration"));
|
||||
const dependency_3 = __importStar(require("./../../../cosmos/base/v1beta1/coin"));
|
||||
const dependency_4 = __importStar(require("./types"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var auction;
|
||||
(function (auction) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class MsgCreateAuction extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("commits_duration" in data && data.commits_duration != undefined) {
|
||||
this.commits_duration = data.commits_duration;
|
||||
}
|
||||
if ("reveals_duration" in data && data.reveals_duration != undefined) {
|
||||
this.reveals_duration = data.reveals_duration;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("minimum_bid" in data && data.minimum_bid != undefined) {
|
||||
this.minimum_bid = data.minimum_bid;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get commits_duration() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 1);
|
||||
}
|
||||
set commits_duration(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get reveals_duration() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2);
|
||||
}
|
||||
set reveals_duration(value) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get commit_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 3);
|
||||
}
|
||||
set commit_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 3, value);
|
||||
}
|
||||
get reveal_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 4);
|
||||
}
|
||||
set reveal_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 4, value);
|
||||
}
|
||||
get minimum_bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 5);
|
||||
}
|
||||
set minimum_bid(value) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 6);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCreateAuction({});
|
||||
if (data.commits_duration != null) {
|
||||
message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration);
|
||||
}
|
||||
if (data.reveals_duration != null) {
|
||||
message.reveals_duration = dependency_2.google.protobuf.Duration.fromObject(data.reveals_duration);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.minimum_bid != null) {
|
||||
message.minimum_bid = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid);
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.commits_duration != null) {
|
||||
data.commits_duration = this.commits_duration.toObject();
|
||||
}
|
||||
if (this.reveals_duration != null) {
|
||||
data.reveals_duration = this.reveals_duration.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.minimum_bid != null) {
|
||||
data.minimum_bid = this.minimum_bid.toObject();
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.commits_duration !== undefined)
|
||||
writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer));
|
||||
if (this.reveals_duration !== undefined)
|
||||
writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer));
|
||||
if (this.commit_fee !== undefined)
|
||||
writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.reveal_fee !== undefined)
|
||||
writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.minimum_bid !== undefined)
|
||||
writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer));
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(6, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateAuction();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.commits_duration, () => message.commits_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.reveals_duration, () => message.reveals_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCreateAuction.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCreateAuction = MsgCreateAuction;
|
||||
class MsgCreateAuctionResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction" in data && data.auction != undefined) {
|
||||
this.auction = data.auction;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Auction, 1);
|
||||
}
|
||||
set auction(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCreateAuctionResponse({});
|
||||
if (data.auction != null) {
|
||||
message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction != null) {
|
||||
data.auction = this.auction.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auction !== undefined)
|
||||
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateAuctionResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auction, () => message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCreateAuctionResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCreateAuctionResponse = MsgCreateAuctionResponse;
|
||||
class MsgCommitBid extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("commit_hash" in data && data.commit_hash != undefined) {
|
||||
this.commit_hash = data.commit_hash;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set auction_id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get commit_hash() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set commit_hash(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 3);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCommitBid({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.commit_hash != null) {
|
||||
message.commit_hash = data.commit_hash;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.commit_hash != null) {
|
||||
data.commit_hash = this.commit_hash;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.auction_id === "string" && this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (typeof this.commit_hash === "string" && this.commit_hash.length)
|
||||
writer.writeString(2, this.commit_hash);
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(3, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCommitBid();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.commit_hash = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCommitBid.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCommitBid = MsgCommitBid;
|
||||
class MsgRevealBid extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("reveal" in data && data.reveal != undefined) {
|
||||
this.reveal = data.reveal;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set auction_id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get reveal() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set reveal(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 3);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgRevealBid({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.reveal != null) {
|
||||
message.reveal = data.reveal;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.reveal != null) {
|
||||
data.reveal = this.reveal;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.auction_id === "string" && this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (typeof this.reveal === "string" && this.reveal.length)
|
||||
writer.writeString(2, this.reveal);
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(3, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRevealBid();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.reveal = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgRevealBid.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgRevealBid = MsgRevealBid;
|
||||
class MsgCommitBidResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bid" in data && data.bid != undefined) {
|
||||
this.bid = data.bid;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Bid, 1);
|
||||
}
|
||||
set bid(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCommitBidResponse({});
|
||||
if (data.bid != null) {
|
||||
message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.fromObject(data.bid);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bid != null) {
|
||||
data.bid = this.bid.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bid !== undefined)
|
||||
writer.writeMessage(1, this.bid, () => this.bid.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCommitBidResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bid, () => message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCommitBidResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCommitBidResponse = MsgCommitBidResponse;
|
||||
class MsgRevealBidResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction" in data && data.auction != undefined) {
|
||||
this.auction = data.auction;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Auction, 1);
|
||||
}
|
||||
set auction(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgRevealBidResponse({});
|
||||
if (data.auction != null) {
|
||||
message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction != null) {
|
||||
data.auction = this.auction.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auction !== undefined)
|
||||
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRevealBidResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auction, () => message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgRevealBidResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgRevealBidResponse = MsgRevealBidResponse;
|
||||
})(v1beta1 = auction.v1beta1 || (auction.v1beta1 = {}));
|
||||
})(auction = vulcanize.auction || (vulcanize.auction = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+284
@@ -0,0 +1,284 @@
|
||||
import * as dependency_2 from "./../../../google/protobuf/duration";
|
||||
import * as dependency_3 from "./../../../google/protobuf/timestamp";
|
||||
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.auction.v1beta1 {
|
||||
class Params extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
commits_duration?: dependency_2.google.protobuf.Duration;
|
||||
reveals_duration?: dependency_2.google.protobuf.Duration;
|
||||
commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
});
|
||||
get commits_duration(): dependency_2.google.protobuf.Duration;
|
||||
set commits_duration(value: dependency_2.google.protobuf.Duration);
|
||||
get reveals_duration(): dependency_2.google.protobuf.Duration;
|
||||
set reveals_duration(value: dependency_2.google.protobuf.Duration);
|
||||
get commit_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get reveal_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get minimum_bid(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
static fromObject(data: {
|
||||
commits_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>;
|
||||
reveals_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>;
|
||||
commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Params;
|
||||
toObject(): {
|
||||
commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Params;
|
||||
}
|
||||
class Auction extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
status?: string;
|
||||
owner_address?: string;
|
||||
create_time?: dependency_3.google.protobuf.Timestamp;
|
||||
commits_end_time?: dependency_3.google.protobuf.Timestamp;
|
||||
reveals_end_time?: dependency_3.google.protobuf.Timestamp;
|
||||
commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
winner_address?: string;
|
||||
winning_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
winning_price?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get status(): string;
|
||||
set status(value: string);
|
||||
get owner_address(): string;
|
||||
set owner_address(value: string);
|
||||
get create_time(): dependency_3.google.protobuf.Timestamp;
|
||||
set create_time(value: dependency_3.google.protobuf.Timestamp);
|
||||
get commits_end_time(): dependency_3.google.protobuf.Timestamp;
|
||||
set commits_end_time(value: dependency_3.google.protobuf.Timestamp);
|
||||
get reveals_end_time(): dependency_3.google.protobuf.Timestamp;
|
||||
set reveals_end_time(value: dependency_3.google.protobuf.Timestamp);
|
||||
get commit_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get reveal_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get minimum_bid(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get winner_address(): string;
|
||||
set winner_address(value: string);
|
||||
get winning_bid(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set winning_bid(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get winning_price(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set winning_price(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
status?: string;
|
||||
owner_address?: string;
|
||||
create_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commits_end_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
reveals_end_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
winner_address?: string;
|
||||
winning_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
winning_price?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Auction;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Auction;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Auction;
|
||||
}
|
||||
class Auctions extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auctions?: Auction[];
|
||||
});
|
||||
get auctions(): Auction[];
|
||||
set auctions(value: Auction[]);
|
||||
static fromObject(data: {
|
||||
auctions?: ReturnType<typeof Auction.prototype.toObject>[];
|
||||
}): Auctions;
|
||||
toObject(): {
|
||||
auctions?: {
|
||||
id?: string | undefined;
|
||||
status?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
create_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commits_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveals_end_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winner_address?: string | undefined;
|
||||
winning_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
winning_price?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Auctions;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Auctions;
|
||||
}
|
||||
class Bid extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
status?: string;
|
||||
commit_hash?: string;
|
||||
commit_time?: dependency_3.google.protobuf.Timestamp;
|
||||
commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
reveal_time?: dependency_3.google.protobuf.Timestamp;
|
||||
reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
bid_amount?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
});
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
get bidder_address(): string;
|
||||
set bidder_address(value: string);
|
||||
get status(): string;
|
||||
set status(value: string);
|
||||
get commit_hash(): string;
|
||||
set commit_hash(value: string);
|
||||
get commit_time(): dependency_3.google.protobuf.Timestamp;
|
||||
set commit_time(value: dependency_3.google.protobuf.Timestamp);
|
||||
get commit_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get reveal_time(): dependency_3.google.protobuf.Timestamp;
|
||||
set reveal_time(value: dependency_3.google.protobuf.Timestamp);
|
||||
get reveal_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get bid_amount(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set bid_amount(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
status?: string;
|
||||
commit_hash?: string;
|
||||
commit_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
reveal_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
bid_amount?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Bid;
|
||||
toObject(): {
|
||||
auction_id?: string | undefined;
|
||||
bidder_address?: string | undefined;
|
||||
status?: string | undefined;
|
||||
commit_hash?: string | undefined;
|
||||
commit_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
reveal_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
bid_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bid;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Bid;
|
||||
}
|
||||
}
|
||||
+735
@@ -0,0 +1,735 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./../../../google/protobuf/duration"));
|
||||
const dependency_3 = __importStar(require("./../../../google/protobuf/timestamp"));
|
||||
const dependency_4 = __importStar(require("./../../../cosmos/base/v1beta1/coin"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var auction;
|
||||
(function (auction) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class Params extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("commits_duration" in data && data.commits_duration != undefined) {
|
||||
this.commits_duration = data.commits_duration;
|
||||
}
|
||||
if ("reveals_duration" in data && data.reveals_duration != undefined) {
|
||||
this.reveals_duration = data.reveals_duration;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("minimum_bid" in data && data.minimum_bid != undefined) {
|
||||
this.minimum_bid = data.minimum_bid;
|
||||
}
|
||||
}
|
||||
}
|
||||
get commits_duration() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 1);
|
||||
}
|
||||
set commits_duration(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get reveals_duration() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2);
|
||||
}
|
||||
set reveals_duration(value) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get commit_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3);
|
||||
}
|
||||
set commit_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 3, value);
|
||||
}
|
||||
get reveal_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 4);
|
||||
}
|
||||
set reveal_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 4, value);
|
||||
}
|
||||
get minimum_bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 5);
|
||||
}
|
||||
set minimum_bid(value) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Params({});
|
||||
if (data.commits_duration != null) {
|
||||
message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration);
|
||||
}
|
||||
if (data.reveals_duration != null) {
|
||||
message.reveals_duration = dependency_2.google.protobuf.Duration.fromObject(data.reveals_duration);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.minimum_bid != null) {
|
||||
message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.commits_duration != null) {
|
||||
data.commits_duration = this.commits_duration.toObject();
|
||||
}
|
||||
if (this.reveals_duration != null) {
|
||||
data.reveals_duration = this.reveals_duration.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.minimum_bid != null) {
|
||||
data.minimum_bid = this.minimum_bid.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.commits_duration !== undefined)
|
||||
writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer));
|
||||
if (this.reveals_duration !== undefined)
|
||||
writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer));
|
||||
if (this.commit_fee !== undefined)
|
||||
writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.reveal_fee !== undefined)
|
||||
writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.minimum_bid !== undefined)
|
||||
writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.commits_duration, () => message.commits_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.reveals_duration, () => message.reveals_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Params.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Params = Params;
|
||||
class Auction extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("status" in data && data.status != undefined) {
|
||||
this.status = data.status;
|
||||
}
|
||||
if ("owner_address" in data && data.owner_address != undefined) {
|
||||
this.owner_address = data.owner_address;
|
||||
}
|
||||
if ("create_time" in data && data.create_time != undefined) {
|
||||
this.create_time = data.create_time;
|
||||
}
|
||||
if ("commits_end_time" in data && data.commits_end_time != undefined) {
|
||||
this.commits_end_time = data.commits_end_time;
|
||||
}
|
||||
if ("reveals_end_time" in data && data.reveals_end_time != undefined) {
|
||||
this.reveals_end_time = data.reveals_end_time;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("minimum_bid" in data && data.minimum_bid != undefined) {
|
||||
this.minimum_bid = data.minimum_bid;
|
||||
}
|
||||
if ("winner_address" in data && data.winner_address != undefined) {
|
||||
this.winner_address = data.winner_address;
|
||||
}
|
||||
if ("winning_bid" in data && data.winning_bid != undefined) {
|
||||
this.winning_bid = data.winning_bid;
|
||||
}
|
||||
if ("winning_price" in data && data.winning_price != undefined) {
|
||||
this.winning_price = data.winning_price;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get status() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set status(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get owner_address() {
|
||||
return pb_1.Message.getField(this, 3);
|
||||
}
|
||||
set owner_address(value) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get create_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 4);
|
||||
}
|
||||
set create_time(value) {
|
||||
pb_1.Message.setWrapperField(this, 4, value);
|
||||
}
|
||||
get commits_end_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5);
|
||||
}
|
||||
set commits_end_time(value) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get reveals_end_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 6);
|
||||
}
|
||||
set reveals_end_time(value) {
|
||||
pb_1.Message.setWrapperField(this, 6, value);
|
||||
}
|
||||
get commit_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 7);
|
||||
}
|
||||
set commit_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 7, value);
|
||||
}
|
||||
get reveal_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8);
|
||||
}
|
||||
set reveal_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 8, value);
|
||||
}
|
||||
get minimum_bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9);
|
||||
}
|
||||
set minimum_bid(value) {
|
||||
pb_1.Message.setWrapperField(this, 9, value);
|
||||
}
|
||||
get winner_address() {
|
||||
return pb_1.Message.getField(this, 10);
|
||||
}
|
||||
set winner_address(value) {
|
||||
pb_1.Message.setField(this, 10, value);
|
||||
}
|
||||
get winning_bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11);
|
||||
}
|
||||
set winning_bid(value) {
|
||||
pb_1.Message.setWrapperField(this, 11, value);
|
||||
}
|
||||
get winning_price() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 12);
|
||||
}
|
||||
set winning_price(value) {
|
||||
pb_1.Message.setWrapperField(this, 12, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Auction({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.status != null) {
|
||||
message.status = data.status;
|
||||
}
|
||||
if (data.owner_address != null) {
|
||||
message.owner_address = data.owner_address;
|
||||
}
|
||||
if (data.create_time != null) {
|
||||
message.create_time = dependency_3.google.protobuf.Timestamp.fromObject(data.create_time);
|
||||
}
|
||||
if (data.commits_end_time != null) {
|
||||
message.commits_end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.commits_end_time);
|
||||
}
|
||||
if (data.reveals_end_time != null) {
|
||||
message.reveals_end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.reveals_end_time);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.minimum_bid != null) {
|
||||
message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid);
|
||||
}
|
||||
if (data.winner_address != null) {
|
||||
message.winner_address = data.winner_address;
|
||||
}
|
||||
if (data.winning_bid != null) {
|
||||
message.winning_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.winning_bid);
|
||||
}
|
||||
if (data.winning_price != null) {
|
||||
message.winning_price = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.winning_price);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.status != null) {
|
||||
data.status = this.status;
|
||||
}
|
||||
if (this.owner_address != null) {
|
||||
data.owner_address = this.owner_address;
|
||||
}
|
||||
if (this.create_time != null) {
|
||||
data.create_time = this.create_time.toObject();
|
||||
}
|
||||
if (this.commits_end_time != null) {
|
||||
data.commits_end_time = this.commits_end_time.toObject();
|
||||
}
|
||||
if (this.reveals_end_time != null) {
|
||||
data.reveals_end_time = this.reveals_end_time.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.minimum_bid != null) {
|
||||
data.minimum_bid = this.minimum_bid.toObject();
|
||||
}
|
||||
if (this.winner_address != null) {
|
||||
data.winner_address = this.winner_address;
|
||||
}
|
||||
if (this.winning_bid != null) {
|
||||
data.winning_bid = this.winning_bid.toObject();
|
||||
}
|
||||
if (this.winning_price != null) {
|
||||
data.winning_price = this.winning_price.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (typeof this.status === "string" && this.status.length)
|
||||
writer.writeString(2, this.status);
|
||||
if (typeof this.owner_address === "string" && this.owner_address.length)
|
||||
writer.writeString(3, this.owner_address);
|
||||
if (this.create_time !== undefined)
|
||||
writer.writeMessage(4, this.create_time, () => this.create_time.serialize(writer));
|
||||
if (this.commits_end_time !== undefined)
|
||||
writer.writeMessage(5, this.commits_end_time, () => this.commits_end_time.serialize(writer));
|
||||
if (this.reveals_end_time !== undefined)
|
||||
writer.writeMessage(6, this.reveals_end_time, () => this.reveals_end_time.serialize(writer));
|
||||
if (this.commit_fee !== undefined)
|
||||
writer.writeMessage(7, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.reveal_fee !== undefined)
|
||||
writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.minimum_bid !== undefined)
|
||||
writer.writeMessage(9, this.minimum_bid, () => this.minimum_bid.serialize(writer));
|
||||
if (typeof this.winner_address === "string" && this.winner_address.length)
|
||||
writer.writeString(10, this.winner_address);
|
||||
if (this.winning_bid !== undefined)
|
||||
writer.writeMessage(11, this.winning_bid, () => this.winning_bid.serialize(writer));
|
||||
if (this.winning_price !== undefined)
|
||||
writer.writeMessage(12, this.winning_price, () => this.winning_price.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Auction();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.status = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.owner_address = reader.readString();
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.create_time, () => message.create_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.commits_end_time, () => message.commits_end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
reader.readMessage(message.reveals_end_time, () => message.reveals_end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 9:
|
||||
reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 10:
|
||||
message.winner_address = reader.readString();
|
||||
break;
|
||||
case 11:
|
||||
reader.readMessage(message.winning_bid, () => message.winning_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 12:
|
||||
reader.readMessage(message.winning_price, () => message.winning_price = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Auction.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Auction = Auction;
|
||||
class Auctions extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Auction, 1);
|
||||
}
|
||||
set auctions(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Auctions({});
|
||||
if (data.auctions != null) {
|
||||
message.auctions = data.auctions.map(item => Auction.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auctions !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.auctions, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Auctions();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auctions, () => pb_1.Message.addToRepeatedWrapperField(message, 1, Auction.deserialize(reader), Auction));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Auctions.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Auctions = Auctions;
|
||||
class Bid extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("bidder_address" in data && data.bidder_address != undefined) {
|
||||
this.bidder_address = data.bidder_address;
|
||||
}
|
||||
if ("status" in data && data.status != undefined) {
|
||||
this.status = data.status;
|
||||
}
|
||||
if ("commit_hash" in data && data.commit_hash != undefined) {
|
||||
this.commit_hash = data.commit_hash;
|
||||
}
|
||||
if ("commit_time" in data && data.commit_time != undefined) {
|
||||
this.commit_time = data.commit_time;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_time" in data && data.reveal_time != undefined) {
|
||||
this.reveal_time = data.reveal_time;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("bid_amount" in data && data.bid_amount != undefined) {
|
||||
this.bid_amount = data.bid_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set auction_id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get bidder_address() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set bidder_address(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get status() {
|
||||
return pb_1.Message.getField(this, 3);
|
||||
}
|
||||
set status(value) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get commit_hash() {
|
||||
return pb_1.Message.getField(this, 4);
|
||||
}
|
||||
set commit_hash(value) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get commit_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5);
|
||||
}
|
||||
set commit_time(value) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get commit_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 6);
|
||||
}
|
||||
set commit_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 6, value);
|
||||
}
|
||||
get reveal_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 7);
|
||||
}
|
||||
set reveal_time(value) {
|
||||
pb_1.Message.setWrapperField(this, 7, value);
|
||||
}
|
||||
get reveal_fee() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8);
|
||||
}
|
||||
set reveal_fee(value) {
|
||||
pb_1.Message.setWrapperField(this, 8, value);
|
||||
}
|
||||
get bid_amount() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9);
|
||||
}
|
||||
set bid_amount(value) {
|
||||
pb_1.Message.setWrapperField(this, 9, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Bid({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.bidder_address != null) {
|
||||
message.bidder_address = data.bidder_address;
|
||||
}
|
||||
if (data.status != null) {
|
||||
message.status = data.status;
|
||||
}
|
||||
if (data.commit_hash != null) {
|
||||
message.commit_hash = data.commit_hash;
|
||||
}
|
||||
if (data.commit_time != null) {
|
||||
message.commit_time = dependency_3.google.protobuf.Timestamp.fromObject(data.commit_time);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_time != null) {
|
||||
message.reveal_time = dependency_3.google.protobuf.Timestamp.fromObject(data.reveal_time);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.bid_amount != null) {
|
||||
message.bid_amount = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.bid_amount);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.bidder_address != null) {
|
||||
data.bidder_address = this.bidder_address;
|
||||
}
|
||||
if (this.status != null) {
|
||||
data.status = this.status;
|
||||
}
|
||||
if (this.commit_hash != null) {
|
||||
data.commit_hash = this.commit_hash;
|
||||
}
|
||||
if (this.commit_time != null) {
|
||||
data.commit_time = this.commit_time.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_time != null) {
|
||||
data.reveal_time = this.reveal_time.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.bid_amount != null) {
|
||||
data.bid_amount = this.bid_amount.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.auction_id === "string" && this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (typeof this.bidder_address === "string" && this.bidder_address.length)
|
||||
writer.writeString(2, this.bidder_address);
|
||||
if (typeof this.status === "string" && this.status.length)
|
||||
writer.writeString(3, this.status);
|
||||
if (typeof this.commit_hash === "string" && this.commit_hash.length)
|
||||
writer.writeString(4, this.commit_hash);
|
||||
if (this.commit_time !== undefined)
|
||||
writer.writeMessage(5, this.commit_time, () => this.commit_time.serialize(writer));
|
||||
if (this.commit_fee !== undefined)
|
||||
writer.writeMessage(6, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.reveal_time !== undefined)
|
||||
writer.writeMessage(7, this.reveal_time, () => this.reveal_time.serialize(writer));
|
||||
if (this.reveal_fee !== undefined)
|
||||
writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.bid_amount !== undefined)
|
||||
writer.writeMessage(9, this.bid_amount, () => this.bid_amount.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bid();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.bidder_address = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.status = reader.readString();
|
||||
break;
|
||||
case 4:
|
||||
message.commit_hash = reader.readString();
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.commit_time, () => message.commit_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.reveal_time, () => message.reveal_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 9:
|
||||
reader.readMessage(message.bid_amount, () => message.bid_amount = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Bid.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Bid = Bid;
|
||||
})(v1beta1 = auction.v1beta1 || (auction.v1beta1 = {}));
|
||||
})(auction = vulcanize.auction || (vulcanize.auction = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.bond.v1beta1 {
|
||||
class Params extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin;
|
||||
});
|
||||
get max_bond_amount(): dependency_2.cosmos.base.v1beta1.Coin;
|
||||
set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin);
|
||||
static fromObject(data: {
|
||||
max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Params;
|
||||
toObject(): {
|
||||
max_bond_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Params;
|
||||
}
|
||||
class Bond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
owner?: string;
|
||||
balance?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get owner(): string;
|
||||
set owner(value: string);
|
||||
get balance(): dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
set balance(value: dependency_2.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
owner?: string;
|
||||
balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): Bond;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
owner?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Bond;
|
||||
}
|
||||
}
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./../../../cosmos/base/v1beta1/coin"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var bond;
|
||||
(function (bond) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class Params extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("max_bond_amount" in data && data.max_bond_amount != undefined) {
|
||||
this.max_bond_amount = data.max_bond_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get max_bond_amount() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 1);
|
||||
}
|
||||
set max_bond_amount(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Params({});
|
||||
if (data.max_bond_amount != null) {
|
||||
message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.max_bond_amount != null) {
|
||||
data.max_bond_amount = this.max_bond_amount.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.max_bond_amount !== undefined)
|
||||
writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.max_bond_amount, () => message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Params.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Params = Params;
|
||||
class Bond extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("owner" in data && data.owner != undefined) {
|
||||
this.owner = data.owner;
|
||||
}
|
||||
if ("balance" in data && data.balance != undefined) {
|
||||
this.balance = data.balance;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get owner() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set owner(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get balance() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3);
|
||||
}
|
||||
set balance(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new Bond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.owner != null) {
|
||||
message.owner = data.owner;
|
||||
}
|
||||
if (data.balance != null) {
|
||||
message.balance = data.balance.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.owner != null) {
|
||||
data.owner = this.owner;
|
||||
}
|
||||
if (this.balance != null) {
|
||||
data.balance = this.balance.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (typeof this.owner === "string" && this.owner.length)
|
||||
writer.writeString(2, this.owner);
|
||||
if (this.balance !== undefined)
|
||||
writer.writeRepeatedMessage(3, this.balance, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.owner = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return Bond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.Bond = Bond;
|
||||
})(v1beta1 = bond.v1beta1 || (bond.v1beta1 = {}));
|
||||
})(bond = vulcanize.bond || (vulcanize.bond = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
import * as dependency_2 from "./bond";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.bond.v1beta1 {
|
||||
class GenesisState extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
});
|
||||
get params(): dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
set params(value: dependency_2.vulcanize.bond.v1beta1.Params);
|
||||
get bonds(): dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]);
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
}): GenesisState;
|
||||
toObject(): {
|
||||
params?: {
|
||||
max_bond_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
bonds?: {
|
||||
id?: string | undefined;
|
||||
owner?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): GenesisState;
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./bond"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var bond;
|
||||
(function (bond) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class GenesisState extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
if ("bonds" in data && data.bonds != undefined) {
|
||||
this.bonds = data.bonds;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Params, 1);
|
||||
}
|
||||
set params(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get bonds() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 2);
|
||||
}
|
||||
set bonds(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new GenesisState({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
if (data.bonds != null) {
|
||||
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
if (this.bonds != null) {
|
||||
data.bonds = this.bonds.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.params !== undefined)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (this.bonds !== undefined)
|
||||
writer.writeRepeatedMessage(2, this.bonds, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.bond.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return GenesisState.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.GenesisState = GenesisState;
|
||||
})(v1beta1 = bond.v1beta1 || (bond.v1beta1 = {}));
|
||||
})(bond = vulcanize.bond || (vulcanize.bond = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
import * as dependency_2 from "./bond";
|
||||
import * as dependency_4 from "./../../../cosmos/base/query/v1beta1/pagination";
|
||||
import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.bond.v1beta1 {
|
||||
class QueryParamsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): QueryParamsRequest;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsRequest;
|
||||
}
|
||||
class QueryParamsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
});
|
||||
get params(): dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
set params(value: dependency_2.vulcanize.bond.v1beta1.Params);
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
|
||||
}): QueryParamsResponse;
|
||||
toObject(): {
|
||||
params?: {
|
||||
max_bond_amount?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsResponse;
|
||||
}
|
||||
class QueryGetBondsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get pagination(): dependency_4.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryGetBondsRequest;
|
||||
toObject(): {
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsRequest;
|
||||
}
|
||||
class QueryGetBondsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get bonds(): dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]);
|
||||
get pagination(): dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetBondsResponse;
|
||||
toObject(): {
|
||||
bonds?: {
|
||||
id?: string | undefined;
|
||||
owner?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsResponse;
|
||||
}
|
||||
class QueryGetBondByIdRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): QueryGetBondByIdRequest;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondByIdRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondByIdRequest;
|
||||
}
|
||||
class QueryGetBondByIdResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bond?: dependency_2.vulcanize.bond.v1beta1.Bond;
|
||||
});
|
||||
get bond(): dependency_2.vulcanize.bond.v1beta1.Bond;
|
||||
set bond(value: dependency_2.vulcanize.bond.v1beta1.Bond);
|
||||
static fromObject(data: {
|
||||
bond?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>;
|
||||
}): QueryGetBondByIdResponse;
|
||||
toObject(): {
|
||||
bond?: {
|
||||
id?: string | undefined;
|
||||
owner?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondByIdResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondByIdResponse;
|
||||
}
|
||||
class QueryGetBondsByOwnerRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
owner?: string;
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get owner(): string;
|
||||
set owner(value: string);
|
||||
get pagination(): dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
owner?: string;
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetBondsByOwnerRequest;
|
||||
toObject(): {
|
||||
owner?: string | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsByOwnerRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsByOwnerRequest;
|
||||
}
|
||||
class QueryGetBondsByOwnerResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get bonds(): dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]);
|
||||
get pagination(): dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetBondsByOwnerResponse;
|
||||
toObject(): {
|
||||
bonds?: {
|
||||
id?: string | undefined;
|
||||
owner?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsByOwnerResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsByOwnerResponse;
|
||||
}
|
||||
class QueryGetBondModuleBalanceRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): QueryGetBondModuleBalanceRequest;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondModuleBalanceRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondModuleBalanceRequest;
|
||||
}
|
||||
class QueryGetBondModuleBalanceResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
balance?: dependency_5.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get balance(): dependency_5.cosmos.base.v1beta1.Coin[];
|
||||
set balance(value: dependency_5.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
balance?: ReturnType<typeof dependency_5.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): QueryGetBondModuleBalanceResponse;
|
||||
toObject(): {
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondModuleBalanceResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondModuleBalanceResponse;
|
||||
}
|
||||
}
|
||||
+647
@@ -0,0 +1,647 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./bond"));
|
||||
const dependency_4 = __importStar(require("./../../../cosmos/base/query/v1beta1/pagination"));
|
||||
const dependency_5 = __importStar(require("./../../../cosmos/base/v1beta1/coin"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var bond;
|
||||
(function (bond) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class QueryParamsRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryParamsRequest({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryParamsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryParamsRequest = QueryParamsRequest;
|
||||
class QueryParamsResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Params, 1);
|
||||
}
|
||||
set params(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryParamsResponse({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.params !== undefined)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.bond.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryParamsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryParamsResponse = QueryParamsResponse;
|
||||
class QueryGetBondsRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageRequest, 1);
|
||||
}
|
||||
set pagination(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondsRequest({});
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.pagination !== undefined)
|
||||
writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondsRequest = QueryGetBondsRequest;
|
||||
class QueryGetBondsResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bonds" in data && data.bonds != undefined) {
|
||||
this.bonds = data.bonds;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bonds() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1);
|
||||
}
|
||||
set bonds(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2);
|
||||
}
|
||||
set pagination(value) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondsResponse({});
|
||||
if (data.bonds != null) {
|
||||
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bonds != null) {
|
||||
data.bonds = this.bonds.map((item) => item.toObject());
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bonds !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.bonds, (item) => item.serialize(writer));
|
||||
if (this.pagination !== undefined)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondsResponse = QueryGetBondsResponse;
|
||||
class QueryGetBondByIdRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondByIdRequest({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondByIdRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondByIdRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondByIdRequest = QueryGetBondByIdRequest;
|
||||
class QueryGetBondByIdResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bond" in data && data.bond != undefined) {
|
||||
this.bond = data.bond;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bond() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1);
|
||||
}
|
||||
set bond(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondByIdResponse({});
|
||||
if (data.bond != null) {
|
||||
message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(data.bond);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bond != null) {
|
||||
data.bond = this.bond.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bond !== undefined)
|
||||
writer.writeMessage(1, this.bond, () => this.bond.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondByIdResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bond, () => message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondByIdResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondByIdResponse = QueryGetBondByIdResponse;
|
||||
class QueryGetBondsByOwnerRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("owner" in data && data.owner != undefined) {
|
||||
this.owner = data.owner;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get owner() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set owner(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2);
|
||||
}
|
||||
set pagination(value) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondsByOwnerRequest({});
|
||||
if (data.owner != null) {
|
||||
message.owner = data.owner;
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.owner != null) {
|
||||
data.owner = this.owner;
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.owner === "string" && this.owner.length)
|
||||
writer.writeString(1, this.owner);
|
||||
if (this.pagination !== undefined)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsByOwnerRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.owner = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondsByOwnerRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondsByOwnerRequest = QueryGetBondsByOwnerRequest;
|
||||
class QueryGetBondsByOwnerResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bonds" in data && data.bonds != undefined) {
|
||||
this.bonds = data.bonds;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bonds() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1);
|
||||
}
|
||||
set bonds(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2);
|
||||
}
|
||||
set pagination(value) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondsByOwnerResponse({});
|
||||
if (data.bonds != null) {
|
||||
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.bonds != null) {
|
||||
data.bonds = this.bonds.map((item) => item.toObject());
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bonds !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.bonds, (item) => item.serialize(writer));
|
||||
if (this.pagination !== undefined)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsByOwnerResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondsByOwnerResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondsByOwnerResponse = QueryGetBondsByOwnerResponse;
|
||||
class QueryGetBondModuleBalanceRequest extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondModuleBalanceRequest({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondModuleBalanceRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondModuleBalanceRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondModuleBalanceRequest = QueryGetBondModuleBalanceRequest;
|
||||
class QueryGetBondModuleBalanceResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("balance" in data && data.balance != undefined) {
|
||||
this.balance = data.balance;
|
||||
}
|
||||
}
|
||||
}
|
||||
get balance() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_5.cosmos.base.v1beta1.Coin, 2);
|
||||
}
|
||||
set balance(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new QueryGetBondModuleBalanceResponse({});
|
||||
if (data.balance != null) {
|
||||
message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.balance != null) {
|
||||
data.balance = this.balance.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.balance !== undefined)
|
||||
writer.writeRepeatedMessage(2, this.balance, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondModuleBalanceResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 2:
|
||||
reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_5.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_5.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return QueryGetBondModuleBalanceResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.QueryGetBondModuleBalanceResponse = QueryGetBondModuleBalanceResponse;
|
||||
})(v1beta1 = bond.v1beta1 || (bond.v1beta1 = {}));
|
||||
})(bond = vulcanize.bond || (vulcanize.bond = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.bond.v1beta1 {
|
||||
class MsgCreateBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
signer?: string;
|
||||
coins?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
get coins(): dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): MsgCreateBond;
|
||||
toObject(): {
|
||||
signer?: string | undefined;
|
||||
coins?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateBond;
|
||||
}
|
||||
class MsgCreateBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): MsgCreateBondResponse;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateBondResponse;
|
||||
}
|
||||
class MsgRefillBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
get coins(): dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): MsgRefillBond;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
coins?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRefillBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRefillBond;
|
||||
}
|
||||
class MsgRefillBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgRefillBondResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRefillBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRefillBondResponse;
|
||||
}
|
||||
class MsgWithdrawBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
get coins(): dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): MsgWithdrawBond;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
coins?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgWithdrawBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgWithdrawBond;
|
||||
}
|
||||
class MsgWithdrawBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgWithdrawBondResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgWithdrawBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgWithdrawBondResponse;
|
||||
}
|
||||
class MsgCancelBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
}): MsgCancelBond;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCancelBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCancelBond;
|
||||
}
|
||||
class MsgCancelBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgCancelBondResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCancelBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCancelBondResponse;
|
||||
}
|
||||
}
|
||||
+566
@@ -0,0 +1,566 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./../../../cosmos/base/v1beta1/coin"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var bond;
|
||||
(function (bond) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class MsgCreateBond extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
if ("coins" in data && data.coins != undefined) {
|
||||
this.coins = data.coins;
|
||||
}
|
||||
}
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get coins() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 2);
|
||||
}
|
||||
set coins(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCreateBond({});
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
if (data.coins != null) {
|
||||
message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
if (this.coins != null) {
|
||||
data.coins = this.coins.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(1, this.signer);
|
||||
if (this.coins !== undefined)
|
||||
writer.writeRepeatedMessage(2, this.coins, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCreateBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCreateBond = MsgCreateBond;
|
||||
class MsgCreateBondResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCreateBondResponse({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCreateBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCreateBondResponse = MsgCreateBondResponse;
|
||||
class MsgRefillBond extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
if ("coins" in data && data.coins != undefined) {
|
||||
this.coins = data.coins;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get coins() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3);
|
||||
}
|
||||
set coins(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgRefillBond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
if (data.coins != null) {
|
||||
message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
if (this.coins != null) {
|
||||
data.coins = this.coins.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(2, this.signer);
|
||||
if (this.coins !== undefined)
|
||||
writer.writeRepeatedMessage(3, this.coins, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRefillBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgRefillBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgRefillBond = MsgRefillBond;
|
||||
class MsgRefillBondResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgRefillBondResponse({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRefillBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgRefillBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgRefillBondResponse = MsgRefillBondResponse;
|
||||
class MsgWithdrawBond extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
if ("coins" in data && data.coins != undefined) {
|
||||
this.coins = data.coins;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get coins() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3);
|
||||
}
|
||||
set coins(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgWithdrawBond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
if (data.coins != null) {
|
||||
message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
if (this.coins != null) {
|
||||
data.coins = this.coins.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(2, this.signer);
|
||||
if (this.coins !== undefined)
|
||||
writer.writeRepeatedMessage(3, this.coins, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgWithdrawBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgWithdrawBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgWithdrawBond = MsgWithdrawBond;
|
||||
class MsgWithdrawBondResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgWithdrawBondResponse({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgWithdrawBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgWithdrawBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgWithdrawBondResponse = MsgWithdrawBondResponse;
|
||||
class MsgCancelBond extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getField(this, 1);
|
||||
}
|
||||
set id(value) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getField(this, 2);
|
||||
}
|
||||
set signer(value) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCancelBond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (typeof this.id === "string" && this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (typeof this.signer === "string" && this.signer.length)
|
||||
writer.writeString(2, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCancelBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCancelBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCancelBond = MsgCancelBond;
|
||||
class MsgCancelBondResponse extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new MsgCancelBondResponse({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCancelBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return MsgCancelBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.MsgCancelBondResponse = MsgCancelBondResponse;
|
||||
})(v1beta1 = bond.v1beta1 || (bond.v1beta1 = {}));
|
||||
})(bond = vulcanize.bond || (vulcanize.bond = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
@@ -0,0 +1,114 @@
|
||||
import * as dependency_2 from "./nameservice";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.nameservice.v1beta1 {
|
||||
class GenesisState extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.nameservice.v1beta1.Params;
|
||||
records?: dependency_2.vulcanize.nameservice.v1beta1.Record[];
|
||||
authorities?: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[];
|
||||
names?: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[];
|
||||
});
|
||||
get params(): dependency_2.vulcanize.nameservice.v1beta1.Params;
|
||||
set params(value: dependency_2.vulcanize.nameservice.v1beta1.Params);
|
||||
get records(): dependency_2.vulcanize.nameservice.v1beta1.Record[];
|
||||
set records(value: dependency_2.vulcanize.nameservice.v1beta1.Record[]);
|
||||
get authorities(): dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[];
|
||||
set authorities(value: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]);
|
||||
get names(): dependency_2.vulcanize.nameservice.v1beta1.NameEntry[];
|
||||
set names(value: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]);
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Params.prototype.toObject>;
|
||||
records?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Record.prototype.toObject>[];
|
||||
authorities?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.prototype.toObject>[];
|
||||
names?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.NameEntry.prototype.toObject>[];
|
||||
}): GenesisState;
|
||||
toObject(): {
|
||||
params?: {
|
||||
record_rent?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
record_rent_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_rent?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_rent_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_grace_period?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_enabled?: boolean | undefined;
|
||||
authority_auction_commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_auction_reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_auction_minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
records?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
}[] | undefined;
|
||||
authorities?: {
|
||||
name?: string | undefined;
|
||||
entry?: {
|
||||
owner_public_key?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
height?: number | undefined;
|
||||
status?: string | undefined;
|
||||
auction_id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
expiry_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
names?: {
|
||||
name?: string | undefined;
|
||||
entry?: {
|
||||
latest?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
} | undefined;
|
||||
history?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): GenesisState;
|
||||
}
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.vulcanize = void 0;
|
||||
const dependency_2 = __importStar(require("./nameservice"));
|
||||
const pb_1 = __importStar(require("google-protobuf"));
|
||||
var vulcanize;
|
||||
(function (vulcanize) {
|
||||
var nameservice;
|
||||
(function (nameservice) {
|
||||
var v1beta1;
|
||||
(function (v1beta1) {
|
||||
class GenesisState extends pb_1.Message {
|
||||
constructor(data) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
if ("records" in data && data.records != undefined) {
|
||||
this.records = data.records;
|
||||
}
|
||||
if ("authorities" in data && data.authorities != undefined) {
|
||||
this.authorities = data.authorities;
|
||||
}
|
||||
if ("names" in data && data.names != undefined) {
|
||||
this.names = data.names;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Params, 1);
|
||||
}
|
||||
set params(value) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get records() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 2);
|
||||
}
|
||||
set records(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
get authorities() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry, 3);
|
||||
}
|
||||
set authorities(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
get names() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.NameEntry, 4);
|
||||
}
|
||||
set names(value) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 4, value);
|
||||
}
|
||||
static fromObject(data) {
|
||||
const message = new GenesisState({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
if (data.records != null) {
|
||||
message.records = data.records.map(item => dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(item));
|
||||
}
|
||||
if (data.authorities != null) {
|
||||
message.authorities = data.authorities.map(item => dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.fromObject(item));
|
||||
}
|
||||
if (data.names != null) {
|
||||
message.names = data.names.map(item => dependency_2.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
if (this.records != null) {
|
||||
data.records = this.records.map((item) => item.toObject());
|
||||
}
|
||||
if (this.authorities != null) {
|
||||
data.authorities = this.authorities.map((item) => item.toObject());
|
||||
}
|
||||
if (this.names != null) {
|
||||
data.names = this.names.map((item) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(w) {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.params !== undefined)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (this.records !== undefined)
|
||||
writer.writeRepeatedMessage(2, this.records, (item) => item.serialize(writer));
|
||||
if (this.authorities !== undefined)
|
||||
writer.writeRepeatedMessage(3, this.authorities, (item) => item.serialize(writer));
|
||||
if (this.names !== undefined)
|
||||
writer.writeRepeatedMessage(4, this.names, (item) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes) {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Record));
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry));
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_2.vulcanize.nameservice.v1beta1.NameEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.NameEntry));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary() {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes) {
|
||||
return GenesisState.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
v1beta1.GenesisState = GenesisState;
|
||||
})(v1beta1 = nameservice.v1beta1 || (nameservice.v1beta1 = {}));
|
||||
})(nameservice = vulcanize.nameservice || (vulcanize.nameservice = {}));
|
||||
})(vulcanize = exports.vulcanize || (exports.vulcanize = {}));
|
||||
@@ -0,0 +1,423 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: vulcanize/nameservice/v1beta1/nameservice.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../google/protobuf/duration";
|
||||
import * as dependency_2 from "./../../../google/protobuf/timestamp";
|
||||
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.nameservice.v1beta1 {
|
||||
class Params extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record_rent?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
record_rent_duration?: dependency_1.google.protobuf.Duration;
|
||||
authority_rent?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
authority_rent_duration?: dependency_1.google.protobuf.Duration;
|
||||
authority_grace_period?: dependency_1.google.protobuf.Duration;
|
||||
authority_auction_enabled?: boolean;
|
||||
authority_auction_commits_duration?: dependency_1.google.protobuf.Duration;
|
||||
authority_auction_reveals_duration?: dependency_1.google.protobuf.Duration;
|
||||
authority_auction_commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
authority_auction_reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
authority_auction_minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
});
|
||||
get record_rent(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set record_rent(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get record_rent_duration(): dependency_1.google.protobuf.Duration;
|
||||
set record_rent_duration(value: dependency_1.google.protobuf.Duration);
|
||||
get authority_rent(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set authority_rent(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get authority_rent_duration(): dependency_1.google.protobuf.Duration;
|
||||
set authority_rent_duration(value: dependency_1.google.protobuf.Duration);
|
||||
get authority_grace_period(): dependency_1.google.protobuf.Duration;
|
||||
set authority_grace_period(value: dependency_1.google.protobuf.Duration);
|
||||
get authority_auction_enabled(): boolean;
|
||||
set authority_auction_enabled(value: boolean);
|
||||
get authority_auction_commits_duration(): dependency_1.google.protobuf.Duration;
|
||||
set authority_auction_commits_duration(value: dependency_1.google.protobuf.Duration);
|
||||
get authority_auction_reveals_duration(): dependency_1.google.protobuf.Duration;
|
||||
set authority_auction_reveals_duration(value: dependency_1.google.protobuf.Duration);
|
||||
get authority_auction_commit_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set authority_auction_commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get authority_auction_reveal_fee(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set authority_auction_reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
get authority_auction_minimum_bid(): dependency_4.cosmos.base.v1beta1.Coin;
|
||||
set authority_auction_minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin);
|
||||
static fromObject(data: {
|
||||
record_rent?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
record_rent_duration?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>;
|
||||
authority_rent?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
authority_rent_duration?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>;
|
||||
authority_grace_period?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>;
|
||||
authority_auction_enabled?: boolean;
|
||||
authority_auction_commits_duration?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>;
|
||||
authority_auction_reveals_duration?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>;
|
||||
authority_auction_commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
authority_auction_reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
authority_auction_minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Params;
|
||||
toObject(): {
|
||||
record_rent?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
record_rent_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_rent?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_rent_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_grace_period?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_enabled?: boolean | undefined;
|
||||
authority_auction_commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_auction_reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_auction_minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Params;
|
||||
}
|
||||
class Record extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
bond_id?: string;
|
||||
create_time?: string;
|
||||
expiry_time?: string;
|
||||
deleted?: boolean;
|
||||
owners?: string[];
|
||||
attributes?: string;
|
||||
names?: string[];
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get bond_id(): string;
|
||||
set bond_id(value: string);
|
||||
get create_time(): string;
|
||||
set create_time(value: string);
|
||||
get expiry_time(): string;
|
||||
set expiry_time(value: string);
|
||||
get deleted(): boolean;
|
||||
set deleted(value: boolean);
|
||||
get owners(): string[];
|
||||
set owners(value: string[]);
|
||||
get attributes(): string;
|
||||
set attributes(value: string);
|
||||
get names(): string[];
|
||||
set names(value: string[]);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
bond_id?: string;
|
||||
create_time?: string;
|
||||
expiry_time?: string;
|
||||
deleted?: boolean;
|
||||
owners?: string[];
|
||||
attributes?: string;
|
||||
names?: string[];
|
||||
}): Record;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Record;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Record;
|
||||
}
|
||||
class AuthorityEntry extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name?: string;
|
||||
entry?: NameAuthority;
|
||||
});
|
||||
get name(): string;
|
||||
set name(value: string);
|
||||
get entry(): NameAuthority;
|
||||
set entry(value: NameAuthority);
|
||||
static fromObject(data: {
|
||||
name?: string;
|
||||
entry?: ReturnType<typeof NameAuthority.prototype.toObject>;
|
||||
}): AuthorityEntry;
|
||||
toObject(): {
|
||||
name?: string | undefined;
|
||||
entry?: {
|
||||
owner_public_key?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
height?: number | undefined;
|
||||
status?: string | undefined;
|
||||
auction_id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
expiry_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuthorityEntry;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuthorityEntry;
|
||||
}
|
||||
class NameAuthority extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
owner_public_key?: string;
|
||||
owner_address?: string;
|
||||
height?: number;
|
||||
status?: string;
|
||||
auction_id?: string;
|
||||
bond_id?: string;
|
||||
expiry_time?: dependency_2.google.protobuf.Timestamp;
|
||||
});
|
||||
get owner_public_key(): string;
|
||||
set owner_public_key(value: string);
|
||||
get owner_address(): string;
|
||||
set owner_address(value: string);
|
||||
get height(): number;
|
||||
set height(value: number);
|
||||
get status(): string;
|
||||
set status(value: string);
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
get bond_id(): string;
|
||||
set bond_id(value: string);
|
||||
get expiry_time(): dependency_2.google.protobuf.Timestamp;
|
||||
set expiry_time(value: dependency_2.google.protobuf.Timestamp);
|
||||
static fromObject(data: {
|
||||
owner_public_key?: string;
|
||||
owner_address?: string;
|
||||
height?: number;
|
||||
status?: string;
|
||||
auction_id?: string;
|
||||
bond_id?: string;
|
||||
expiry_time?: ReturnType<typeof dependency_2.google.protobuf.Timestamp.prototype.toObject>;
|
||||
}): NameAuthority;
|
||||
toObject(): {
|
||||
owner_public_key?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
height?: number | undefined;
|
||||
status?: string | undefined;
|
||||
auction_id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
expiry_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameAuthority;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): NameAuthority;
|
||||
}
|
||||
class NameEntry extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name?: string;
|
||||
entry?: NameRecord;
|
||||
});
|
||||
get name(): string;
|
||||
set name(value: string);
|
||||
get entry(): NameRecord;
|
||||
set entry(value: NameRecord);
|
||||
static fromObject(data: {
|
||||
name?: string;
|
||||
entry?: ReturnType<typeof NameRecord.prototype.toObject>;
|
||||
}): NameEntry;
|
||||
toObject(): {
|
||||
name?: string | undefined;
|
||||
entry?: {
|
||||
latest?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
} | undefined;
|
||||
history?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameEntry;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): NameEntry;
|
||||
}
|
||||
class NameRecord extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
latest?: NameRecordEntry;
|
||||
history?: NameRecordEntry[];
|
||||
});
|
||||
get latest(): NameRecordEntry;
|
||||
set latest(value: NameRecordEntry);
|
||||
get history(): NameRecordEntry[];
|
||||
set history(value: NameRecordEntry[]);
|
||||
static fromObject(data: {
|
||||
latest?: ReturnType<typeof NameRecordEntry.prototype.toObject>;
|
||||
history?: ReturnType<typeof NameRecordEntry.prototype.toObject>[];
|
||||
}): NameRecord;
|
||||
toObject(): {
|
||||
latest?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
} | undefined;
|
||||
history?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameRecord;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): NameRecord;
|
||||
}
|
||||
class NameRecordEntry extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
height?: number;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get height(): number;
|
||||
set height(value: number);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
height?: number;
|
||||
}): NameRecordEntry;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameRecordEntry;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): NameRecordEntry;
|
||||
}
|
||||
class Signature extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
sig?: string;
|
||||
pub_key?: string;
|
||||
});
|
||||
get sig(): string;
|
||||
set sig(value: string);
|
||||
get pub_key(): string;
|
||||
set pub_key(value: string);
|
||||
static fromObject(data: {
|
||||
sig?: string;
|
||||
pub_key?: string;
|
||||
}): Signature;
|
||||
toObject(): {
|
||||
sig?: string | undefined;
|
||||
pub_key?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signature;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Signature;
|
||||
}
|
||||
class BlockChangeSet extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
height?: number;
|
||||
records?: string[];
|
||||
auctions?: string[];
|
||||
auction_bids?: AuctionBidInfo[];
|
||||
authorities?: string[];
|
||||
names?: string[];
|
||||
});
|
||||
get height(): number;
|
||||
set height(value: number);
|
||||
get records(): string[];
|
||||
set records(value: string[]);
|
||||
get auctions(): string[];
|
||||
set auctions(value: string[]);
|
||||
get auction_bids(): AuctionBidInfo[];
|
||||
set auction_bids(value: AuctionBidInfo[]);
|
||||
get authorities(): string[];
|
||||
set authorities(value: string[]);
|
||||
get names(): string[];
|
||||
set names(value: string[]);
|
||||
static fromObject(data: {
|
||||
height?: number;
|
||||
records?: string[];
|
||||
auctions?: string[];
|
||||
auction_bids?: ReturnType<typeof AuctionBidInfo.prototype.toObject>[];
|
||||
authorities?: string[];
|
||||
names?: string[];
|
||||
}): BlockChangeSet;
|
||||
toObject(): {
|
||||
height?: number | undefined;
|
||||
records?: string[] | undefined;
|
||||
auctions?: string[] | undefined;
|
||||
auction_bids?: {
|
||||
auction_id?: string | undefined;
|
||||
bidder_address?: string | undefined;
|
||||
}[] | undefined;
|
||||
authorities?: string[] | undefined;
|
||||
names?: string[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BlockChangeSet;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): BlockChangeSet;
|
||||
}
|
||||
class AuctionBidInfo extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
});
|
||||
get auction_id(): string;
|
||||
set auction_id(value: string);
|
||||
get bidder_address(): string;
|
||||
set bidder_address(value: string);
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
}): AuctionBidInfo;
|
||||
toObject(): {
|
||||
auction_id?: string | undefined;
|
||||
bidder_address?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionBidInfo;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AuctionBidInfo;
|
||||
}
|
||||
}
|
||||
+1316
File diff suppressed because it is too large
Load Diff
+773
@@ -0,0 +1,773 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.14.0
|
||||
* source: vulcanize/nameservice/v1beta1/query.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./nameservice";
|
||||
import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination";
|
||||
import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.nameservice.v1beta1 {
|
||||
class QueryParamsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): QueryParamsRequest;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsRequest;
|
||||
}
|
||||
class QueryParamsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_1.vulcanize.nameservice.v1beta1.Params;
|
||||
});
|
||||
get params(): dependency_1.vulcanize.nameservice.v1beta1.Params;
|
||||
set params(value: dependency_1.vulcanize.nameservice.v1beta1.Params);
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.Params.prototype.toObject>;
|
||||
}): QueryParamsResponse;
|
||||
toObject(): {
|
||||
params?: {
|
||||
record_rent?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
record_rent_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_rent?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_rent_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_grace_period?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_enabled?: boolean | undefined;
|
||||
authority_auction_commits_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_reveals_duration?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
authority_auction_commit_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_auction_reveal_fee?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
authority_auction_minimum_bid?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsResponse;
|
||||
}
|
||||
class QueryListRecordsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
attributes?: QueryListRecordsRequest.KeyValueInput[];
|
||||
all?: boolean;
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get attributes(): QueryListRecordsRequest.KeyValueInput[];
|
||||
set attributes(value: QueryListRecordsRequest.KeyValueInput[]);
|
||||
get all(): boolean;
|
||||
set all(value: boolean);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
attributes?: ReturnType<typeof QueryListRecordsRequest.KeyValueInput.prototype.toObject>[];
|
||||
all?: boolean;
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryListRecordsRequest;
|
||||
toObject(): {
|
||||
attributes?: {
|
||||
key?: string | undefined;
|
||||
value?: {
|
||||
type?: string | undefined;
|
||||
string?: string | undefined;
|
||||
int?: number | undefined;
|
||||
float?: number | undefined;
|
||||
boolean?: boolean | undefined;
|
||||
reference?: {
|
||||
id?: string | undefined;
|
||||
} | undefined;
|
||||
values?: any[] | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
all?: boolean | undefined;
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListRecordsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryListRecordsRequest;
|
||||
}
|
||||
namespace QueryListRecordsRequest {
|
||||
class ReferenceInput extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): ReferenceInput;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ReferenceInput;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): ReferenceInput;
|
||||
}
|
||||
class ValueInput extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
type?: string;
|
||||
string?: string;
|
||||
int?: number;
|
||||
float?: number;
|
||||
boolean?: boolean;
|
||||
reference?: QueryListRecordsRequest.ReferenceInput;
|
||||
values?: QueryListRecordsRequest.ValueInput[];
|
||||
});
|
||||
get type(): string;
|
||||
set type(value: string);
|
||||
get string(): string;
|
||||
set string(value: string);
|
||||
get int(): number;
|
||||
set int(value: number);
|
||||
get float(): number;
|
||||
set float(value: number);
|
||||
get boolean(): boolean;
|
||||
set boolean(value: boolean);
|
||||
get reference(): QueryListRecordsRequest.ReferenceInput;
|
||||
set reference(value: QueryListRecordsRequest.ReferenceInput);
|
||||
get values(): QueryListRecordsRequest.ValueInput[];
|
||||
set values(value: QueryListRecordsRequest.ValueInput[]);
|
||||
static fromObject(data: {
|
||||
type?: string;
|
||||
string?: string;
|
||||
int?: number;
|
||||
float?: number;
|
||||
boolean?: boolean;
|
||||
reference?: ReturnType<typeof QueryListRecordsRequest.ReferenceInput.prototype.toObject>;
|
||||
values?: ReturnType<typeof QueryListRecordsRequest.ValueInput.prototype.toObject>[];
|
||||
}): ValueInput;
|
||||
toObject(): {
|
||||
type?: string | undefined;
|
||||
string?: string | undefined;
|
||||
int?: number | undefined;
|
||||
float?: number | undefined;
|
||||
boolean?: boolean | undefined;
|
||||
reference?: {
|
||||
id?: string | undefined;
|
||||
} | undefined;
|
||||
values?: {
|
||||
type?: string | undefined;
|
||||
string?: string | undefined;
|
||||
int?: number | undefined;
|
||||
float?: number | undefined;
|
||||
boolean?: boolean | undefined;
|
||||
reference?: {
|
||||
id?: string | undefined;
|
||||
} | undefined;
|
||||
values?: any[] | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ValueInput;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): ValueInput;
|
||||
}
|
||||
class KeyValueInput extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
key?: string;
|
||||
value?: QueryListRecordsRequest.ValueInput;
|
||||
});
|
||||
get key(): string;
|
||||
set key(value: string);
|
||||
get value(): QueryListRecordsRequest.ValueInput;
|
||||
set value(value: QueryListRecordsRequest.ValueInput);
|
||||
static fromObject(data: {
|
||||
key?: string;
|
||||
value?: ReturnType<typeof QueryListRecordsRequest.ValueInput.prototype.toObject>;
|
||||
}): KeyValueInput;
|
||||
toObject(): {
|
||||
key?: string | undefined;
|
||||
value?: {
|
||||
type?: string | undefined;
|
||||
string?: string | undefined;
|
||||
int?: number | undefined;
|
||||
float?: number | undefined;
|
||||
boolean?: boolean | undefined;
|
||||
reference?: {
|
||||
id?: string | undefined;
|
||||
} | undefined;
|
||||
values?: any[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): KeyValueInput;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): KeyValueInput;
|
||||
}
|
||||
}
|
||||
class QueryListRecordsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
records?: dependency_1.vulcanize.nameservice.v1beta1.Record[];
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get records(): dependency_1.vulcanize.nameservice.v1beta1.Record[];
|
||||
set records(value: dependency_1.vulcanize.nameservice.v1beta1.Record[]);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
records?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.Record.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryListRecordsResponse;
|
||||
toObject(): {
|
||||
records?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListRecordsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryListRecordsResponse;
|
||||
}
|
||||
class QueryRecordByIdRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): QueryRecordByIdRequest;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIdRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryRecordByIdRequest;
|
||||
}
|
||||
class QueryRecordByIdResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record?: dependency_1.vulcanize.nameservice.v1beta1.Record;
|
||||
});
|
||||
get record(): dependency_1.vulcanize.nameservice.v1beta1.Record;
|
||||
set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record);
|
||||
static fromObject(data: {
|
||||
record?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.Record.prototype.toObject>;
|
||||
}): QueryRecordByIdResponse;
|
||||
toObject(): {
|
||||
record?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIdResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryRecordByIdResponse;
|
||||
}
|
||||
class QueryRecordByBondIdRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryRecordByBondIdRequest;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIdRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIdRequest;
|
||||
}
|
||||
class QueryRecordByBondIdResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
records?: dependency_1.vulcanize.nameservice.v1beta1.Record[];
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get records(): dependency_1.vulcanize.nameservice.v1beta1.Record[];
|
||||
set records(value: dependency_1.vulcanize.nameservice.v1beta1.Record[]);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
records?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.Record.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryRecordByBondIdResponse;
|
||||
toObject(): {
|
||||
records?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIdResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIdResponse;
|
||||
}
|
||||
class GetNameServiceModuleBalanceRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): GetNameServiceModuleBalanceRequest;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNameServiceModuleBalanceRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): GetNameServiceModuleBalanceRequest;
|
||||
}
|
||||
class GetNameServiceModuleBalanceResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
balances?: AccountBalance[];
|
||||
});
|
||||
get balances(): AccountBalance[];
|
||||
set balances(value: AccountBalance[]);
|
||||
static fromObject(data: {
|
||||
balances?: ReturnType<typeof AccountBalance.prototype.toObject>[];
|
||||
}): GetNameServiceModuleBalanceResponse;
|
||||
toObject(): {
|
||||
balances?: {
|
||||
account_name?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNameServiceModuleBalanceResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): GetNameServiceModuleBalanceResponse;
|
||||
}
|
||||
class AccountBalance extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
account_name?: string;
|
||||
balance?: dependency_5.cosmos.base.v1beta1.Coin[];
|
||||
});
|
||||
get account_name(): string;
|
||||
set account_name(value: string);
|
||||
get balance(): dependency_5.cosmos.base.v1beta1.Coin[];
|
||||
set balance(value: dependency_5.cosmos.base.v1beta1.Coin[]);
|
||||
static fromObject(data: {
|
||||
account_name?: string;
|
||||
balance?: ReturnType<typeof dependency_5.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): AccountBalance;
|
||||
toObject(): {
|
||||
account_name?: string | undefined;
|
||||
balance?: {
|
||||
denom?: string | undefined;
|
||||
amount?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AccountBalance;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): AccountBalance;
|
||||
}
|
||||
class QueryListNameRecordsRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryListNameRecordsRequest;
|
||||
toObject(): {
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListNameRecordsRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryListNameRecordsRequest;
|
||||
}
|
||||
class QueryListNameRecordsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
names?: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[];
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get names(): dependency_1.vulcanize.nameservice.v1beta1.NameEntry[];
|
||||
set names(value: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
names?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.NameEntry.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryListNameRecordsResponse;
|
||||
toObject(): {
|
||||
names?: {
|
||||
name?: string | undefined;
|
||||
entry?: {
|
||||
latest?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
} | undefined;
|
||||
history?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListNameRecordsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryListNameRecordsResponse;
|
||||
}
|
||||
class QueryWhoisRequest extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name?: string;
|
||||
});
|
||||
get name(): string;
|
||||
set name(value: string);
|
||||
static fromObject(data: {
|
||||
name?: string;
|
||||
}): QueryWhoisRequest;
|
||||
toObject(): {
|
||||
name?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryWhoisRequest;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryWhoisRequest;
|
||||
}
|
||||
class QueryWhoisResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name_authority?: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority;
|
||||
});
|
||||
get name_authority(): dependency_1.vulcanize.nameservice.v1beta1.NameAuthority;
|
||||
set name_authority(value: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority);
|
||||
static fromObject(data: {
|
||||
name_authority?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.NameAuthority.prototype.toObject>;
|
||||
}): QueryWhoisResponse;
|
||||
toObject(): {
|
||||
name_authority?: {
|
||||
owner_public_key?: string | undefined;
|
||||
owner_address?: string | undefined;
|
||||
height?: number | undefined;
|
||||
status?: string | undefined;
|
||||
auction_id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
expiry_time?: {
|
||||
seconds?: number | undefined;
|
||||
nanos?: number | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryWhoisResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryWhoisResponse;
|
||||
}
|
||||
class QueryLookupCrn extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
crn?: string;
|
||||
});
|
||||
get crn(): string;
|
||||
set crn(value: string);
|
||||
static fromObject(data: {
|
||||
crn?: string;
|
||||
}): QueryLookupCrn;
|
||||
toObject(): {
|
||||
crn?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryLookupCrn;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryLookupCrn;
|
||||
}
|
||||
class QueryLookupCrnResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name?: dependency_1.vulcanize.nameservice.v1beta1.NameRecord;
|
||||
});
|
||||
get name(): dependency_1.vulcanize.nameservice.v1beta1.NameRecord;
|
||||
set name(value: dependency_1.vulcanize.nameservice.v1beta1.NameRecord);
|
||||
static fromObject(data: {
|
||||
name?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.NameRecord.prototype.toObject>;
|
||||
}): QueryLookupCrnResponse;
|
||||
toObject(): {
|
||||
name?: {
|
||||
latest?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
} | undefined;
|
||||
history?: {
|
||||
id?: string | undefined;
|
||||
height?: number | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryLookupCrnResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryLookupCrnResponse;
|
||||
}
|
||||
class QueryResolveCrn extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
crn?: string;
|
||||
});
|
||||
get crn(): string;
|
||||
set crn(value: string);
|
||||
static fromObject(data: {
|
||||
crn?: string;
|
||||
}): QueryResolveCrn;
|
||||
toObject(): {
|
||||
crn?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryResolveCrn;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryResolveCrn;
|
||||
}
|
||||
class QueryResolveCrnResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record?: dependency_1.vulcanize.nameservice.v1beta1.Record;
|
||||
});
|
||||
get record(): dependency_1.vulcanize.nameservice.v1beta1.Record;
|
||||
set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record);
|
||||
static fromObject(data: {
|
||||
record?: ReturnType<typeof dependency_1.vulcanize.nameservice.v1beta1.Record.prototype.toObject>;
|
||||
}): QueryResolveCrnResponse;
|
||||
toObject(): {
|
||||
record?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryResolveCrnResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryResolveCrnResponse;
|
||||
}
|
||||
class QueryGetRecordExpiryQueue extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryGetRecordExpiryQueue;
|
||||
toObject(): {
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetRecordExpiryQueue;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetRecordExpiryQueue;
|
||||
}
|
||||
class QueryGetRecordExpiryQueueResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
records?: ExpiryQueueRecord[];
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get records(): ExpiryQueueRecord[];
|
||||
set records(value: ExpiryQueueRecord[]);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
records?: ReturnType<typeof ExpiryQueueRecord.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetRecordExpiryQueueResponse;
|
||||
toObject(): {
|
||||
records?: {
|
||||
id?: string | undefined;
|
||||
value?: string[] | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetRecordExpiryQueueResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetRecordExpiryQueueResponse;
|
||||
}
|
||||
class ExpiryQueueRecord extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
value?: string[];
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
get value(): string[];
|
||||
set value(value: string[]);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
value?: string[];
|
||||
}): ExpiryQueueRecord;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
value?: string[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExpiryQueueRecord;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): ExpiryQueueRecord;
|
||||
}
|
||||
class QueryGetAuthorityExpiryQueue extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
});
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageRequest;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest);
|
||||
static fromObject(data: {
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryGetAuthorityExpiryQueue;
|
||||
toObject(): {
|
||||
pagination?: {
|
||||
key?: Uint8Array | undefined;
|
||||
offset?: number | undefined;
|
||||
limit?: number | undefined;
|
||||
count_total?: boolean | undefined;
|
||||
reverse?: boolean | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetAuthorityExpiryQueue;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetAuthorityExpiryQueue;
|
||||
}
|
||||
class QueryGetAuthorityExpiryQueueResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
authorities?: ExpiryQueueRecord[];
|
||||
pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
});
|
||||
get authorities(): ExpiryQueueRecord[];
|
||||
set authorities(value: ExpiryQueueRecord[]);
|
||||
get pagination(): dependency_3.cosmos.base.query.v1beta1.PageResponse;
|
||||
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse);
|
||||
static fromObject(data: {
|
||||
authorities?: ReturnType<typeof ExpiryQueueRecord.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetAuthorityExpiryQueueResponse;
|
||||
toObject(): {
|
||||
authorities?: {
|
||||
id?: string | undefined;
|
||||
value?: string[] | undefined;
|
||||
}[] | undefined;
|
||||
pagination?: {
|
||||
next_key?: Uint8Array | undefined;
|
||||
total?: number | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetAuthorityExpiryQueueResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetAuthorityExpiryQueueResponse;
|
||||
}
|
||||
}
|
||||
+1939
File diff suppressed because it is too large
Load Diff
+422
@@ -0,0 +1,422 @@
|
||||
import * as dependency_2 from "./nameservice";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export declare namespace vulcanize.nameservice.v1beta1 {
|
||||
class MsgSetRecord extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
payload?: Payload;
|
||||
});
|
||||
get bond_id(): string;
|
||||
set bond_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
get payload(): Payload;
|
||||
set payload(value: Payload);
|
||||
static fromObject(data: {
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
payload?: ReturnType<typeof Payload.prototype.toObject>;
|
||||
}): MsgSetRecord;
|
||||
toObject(): {
|
||||
bond_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
payload?: {
|
||||
record?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
} | undefined;
|
||||
signatures?: {
|
||||
sig?: string | undefined;
|
||||
pub_key?: string | undefined;
|
||||
}[] | undefined;
|
||||
} | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetRecord;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgSetRecord;
|
||||
}
|
||||
class MsgSetRecordResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
});
|
||||
get id(): string;
|
||||
set id(value: string);
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): MsgSetRecordResponse;
|
||||
toObject(): {
|
||||
id?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetRecordResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgSetRecordResponse;
|
||||
}
|
||||
class Payload extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record?: dependency_2.vulcanize.nameservice.v1beta1.Record;
|
||||
signatures?: dependency_2.vulcanize.nameservice.v1beta1.Signature[];
|
||||
});
|
||||
get record(): dependency_2.vulcanize.nameservice.v1beta1.Record;
|
||||
set record(value: dependency_2.vulcanize.nameservice.v1beta1.Record);
|
||||
get signatures(): dependency_2.vulcanize.nameservice.v1beta1.Signature[];
|
||||
set signatures(value: dependency_2.vulcanize.nameservice.v1beta1.Signature[]);
|
||||
static fromObject(data: {
|
||||
record?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Record.prototype.toObject>;
|
||||
signatures?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Signature.prototype.toObject>[];
|
||||
}): Payload;
|
||||
toObject(): {
|
||||
record?: {
|
||||
id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
create_time?: string | undefined;
|
||||
expiry_time?: string | undefined;
|
||||
deleted?: boolean | undefined;
|
||||
owners?: string[] | undefined;
|
||||
attributes?: string | undefined;
|
||||
names?: string[] | undefined;
|
||||
} | undefined;
|
||||
signatures?: {
|
||||
sig?: string | undefined;
|
||||
pub_key?: string | undefined;
|
||||
}[] | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Payload;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): Payload;
|
||||
}
|
||||
class MsgSetName extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
crn?: string;
|
||||
cid?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get crn(): string;
|
||||
set crn(value: string);
|
||||
get cid(): string;
|
||||
set cid(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
crn?: string;
|
||||
cid?: string;
|
||||
signer?: string;
|
||||
}): MsgSetName;
|
||||
toObject(): {
|
||||
crn?: string | undefined;
|
||||
cid?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetName;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgSetName;
|
||||
}
|
||||
class MsgSetNameResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgSetNameResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetNameResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgSetNameResponse;
|
||||
}
|
||||
class MsgReserveAuthority extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name?: string;
|
||||
signer?: string;
|
||||
owner?: string;
|
||||
});
|
||||
get name(): string;
|
||||
set name(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
get owner(): string;
|
||||
set owner(value: string);
|
||||
static fromObject(data: {
|
||||
name?: string;
|
||||
signer?: string;
|
||||
owner?: string;
|
||||
}): MsgReserveAuthority;
|
||||
toObject(): {
|
||||
name?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
owner?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReserveAuthority;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgReserveAuthority;
|
||||
}
|
||||
class MsgReserveAuthorityResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgReserveAuthorityResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReserveAuthorityResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgReserveAuthorityResponse;
|
||||
}
|
||||
class MsgSetAuthorityBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
name?: string;
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get name(): string;
|
||||
set name(value: string);
|
||||
get bond_id(): string;
|
||||
set bond_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
name?: string;
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
}): MsgSetAuthorityBond;
|
||||
toObject(): {
|
||||
name?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetAuthorityBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgSetAuthorityBond;
|
||||
}
|
||||
class MsgSetAuthorityBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgSetAuthorityBondResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetAuthorityBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgSetAuthorityBondResponse;
|
||||
}
|
||||
class MsgDeleteNameAuthority extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
crn?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get crn(): string;
|
||||
set crn(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
crn?: string;
|
||||
signer?: string;
|
||||
}): MsgDeleteNameAuthority;
|
||||
toObject(): {
|
||||
crn?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDeleteNameAuthority;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgDeleteNameAuthority;
|
||||
}
|
||||
class MsgDeleteNameAuthorityResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgDeleteNameAuthorityResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDeleteNameAuthorityResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgDeleteNameAuthorityResponse;
|
||||
}
|
||||
class MsgRenewRecord extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record_id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get record_id(): string;
|
||||
set record_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
record_id?: string;
|
||||
signer?: string;
|
||||
}): MsgRenewRecord;
|
||||
toObject(): {
|
||||
record_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRenewRecord;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRenewRecord;
|
||||
}
|
||||
class MsgRenewRecordResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgRenewRecordResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRenewRecordResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRenewRecordResponse;
|
||||
}
|
||||
class MsgAssociateBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record_id?: string;
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get record_id(): string;
|
||||
set record_id(value: string);
|
||||
get bond_id(): string;
|
||||
set bond_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
record_id?: string;
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
}): MsgAssociateBond;
|
||||
toObject(): {
|
||||
record_id?: string | undefined;
|
||||
bond_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgAssociateBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgAssociateBond;
|
||||
}
|
||||
class MsgAssociateBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgAssociateBondResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgAssociateBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgAssociateBondResponse;
|
||||
}
|
||||
class MsgDissociateBond extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
record_id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get record_id(): string;
|
||||
set record_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
record_id?: string;
|
||||
signer?: string;
|
||||
}): MsgDissociateBond;
|
||||
toObject(): {
|
||||
record_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateBond;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgDissociateBond;
|
||||
}
|
||||
class MsgDissociateBondResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgDissociateBondResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateBondResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgDissociateBondResponse;
|
||||
}
|
||||
class MsgDissociateRecords extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get bond_id(): string;
|
||||
set bond_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
bond_id?: string;
|
||||
signer?: string;
|
||||
}): MsgDissociateRecords;
|
||||
toObject(): {
|
||||
bond_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateRecords;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgDissociateRecords;
|
||||
}
|
||||
class MsgDissociateRecordsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgDissociateRecordsResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateRecordsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgDissociateRecordsResponse;
|
||||
}
|
||||
class MsgReAssociateRecords extends pb_1.Message {
|
||||
constructor(data?: any[] | {
|
||||
new_bond_id?: string;
|
||||
old_bond_id?: string;
|
||||
signer?: string;
|
||||
});
|
||||
get new_bond_id(): string;
|
||||
set new_bond_id(value: string);
|
||||
get old_bond_id(): string;
|
||||
set old_bond_id(value: string);
|
||||
get signer(): string;
|
||||
set signer(value: string);
|
||||
static fromObject(data: {
|
||||
new_bond_id?: string;
|
||||
old_bond_id?: string;
|
||||
signer?: string;
|
||||
}): MsgReAssociateRecords;
|
||||
toObject(): {
|
||||
new_bond_id?: string | undefined;
|
||||
old_bond_id?: string | undefined;
|
||||
signer?: string | undefined;
|
||||
};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReAssociateRecords;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgReAssociateRecords;
|
||||
}
|
||||
class MsgReAssociateRecordsResponse extends pb_1.Message {
|
||||
constructor(data?: any[] | {});
|
||||
static fromObject(data: {}): MsgReAssociateRecordsResponse;
|
||||
toObject(): {};
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReAssociateRecordsResponse;
|
||||
serializeBinary(): Uint8Array;
|
||||
static deserializeBinary(bytes: Uint8Array): MsgReAssociateRecordsResponse;
|
||||
}
|
||||
}
|
||||
+1427
File diff suppressed because it is too large
Load Diff
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Registry
|
||||
*/
|
||||
export declare class RegistryClient {
|
||||
_restEndpoint: string;
|
||||
_graph: any;
|
||||
/**
|
||||
* Get query result.
|
||||
*/
|
||||
static getResult(query: any, key: string, modifier?: (rows: any[]) => {}): Promise<any>;
|
||||
/**
|
||||
* Prepare response attributes.
|
||||
*/
|
||||
static prepareAttributes(path: string): (rows: any[]) => any[];
|
||||
/**
|
||||
* New Client.
|
||||
*/
|
||||
constructor(restEndpoint: string, gqlEndpoint: string);
|
||||
/**
|
||||
* Get server status.
|
||||
*/
|
||||
getStatus(): Promise<any>;
|
||||
/**
|
||||
* Fetch Accounts.
|
||||
*/
|
||||
getAccounts(addresses: string[]): Promise<any>;
|
||||
/**
|
||||
* Get records by ids.
|
||||
*/
|
||||
getRecordsByIds(ids: string[], refs?: boolean): Promise<any>;
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
queryRecords(attributes: {
|
||||
[key: string]: any;
|
||||
}, all?: boolean, refs?: boolean): Promise<any>;
|
||||
/**
|
||||
* Lookup authorities by names.
|
||||
*/
|
||||
lookupAuthorities(names: string[], auction?: boolean): Promise<any>;
|
||||
/**
|
||||
* Get auctions by ids.
|
||||
*/
|
||||
getAuctionsByIds(ids: string[]): Promise<any>;
|
||||
/**
|
||||
* Lookup names.
|
||||
*/
|
||||
lookupNames(names: string[], history?: boolean): Promise<any>;
|
||||
/**
|
||||
* Resolve names to records.
|
||||
*/
|
||||
resolveNames(names: string[], refs?: boolean): Promise<any>;
|
||||
/**
|
||||
* Get bonds by ids.
|
||||
*/
|
||||
getBondsByIds(ids: string[]): Promise<any>;
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
queryBonds(attributes?: {}): Promise<any>;
|
||||
/**
|
||||
* Submit transaction.
|
||||
*/
|
||||
submit(tx: string): Promise<any>;
|
||||
}
|
||||
Vendored
+409
@@ -0,0 +1,409 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RegistryClient = void 0;
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const axios_1 = __importDefault(require("axios"));
|
||||
const graphql_js_1 = __importDefault(require("graphql.js"));
|
||||
const lodash_1 = require("lodash");
|
||||
const provider_1 = require("@tharsis/provider");
|
||||
const util_1 = require("./util");
|
||||
const attributeField = `
|
||||
attributes {
|
||||
key
|
||||
value {
|
||||
null
|
||||
int
|
||||
float
|
||||
string
|
||||
boolean
|
||||
json
|
||||
reference {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
const refsField = `
|
||||
references {
|
||||
id
|
||||
}
|
||||
`;
|
||||
const historyFields = `
|
||||
history {
|
||||
id
|
||||
height
|
||||
}
|
||||
`;
|
||||
const auctionFields = `
|
||||
id
|
||||
status
|
||||
ownerAddress
|
||||
createTime
|
||||
commitsEndTime
|
||||
revealsEndTime
|
||||
commitFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
revealFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
minimumBid {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
winnerAddress
|
||||
winnerBid {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
winnerPrice {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
bids {
|
||||
bidderAddress
|
||||
status
|
||||
commitHash
|
||||
commitTime
|
||||
revealTime
|
||||
commitFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
revealFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
bidAmount {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
}
|
||||
`;
|
||||
/**
|
||||
* Registry
|
||||
*/
|
||||
class RegistryClient {
|
||||
/**
|
||||
* New Client.
|
||||
*/
|
||||
constructor(restEndpoint, gqlEndpoint) {
|
||||
(0, assert_1.default)(restEndpoint);
|
||||
this._restEndpoint = restEndpoint;
|
||||
this._graph = (0, graphql_js_1.default)(gqlEndpoint, {
|
||||
method: 'POST',
|
||||
asJSON: true
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get query result.
|
||||
*/
|
||||
static getResult(query, key, modifier) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const result = yield query;
|
||||
if (result && result[key] && result[key].length && result[key][0] !== null) {
|
||||
if (modifier) {
|
||||
return modifier(result[key]);
|
||||
}
|
||||
return result[key];
|
||||
}
|
||||
return [];
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Prepare response attributes.
|
||||
*/
|
||||
static prepareAttributes(path) {
|
||||
return (rows) => {
|
||||
const result = rows.map(r => {
|
||||
(0, lodash_1.set)(r, path, util_1.Util.fromGQLAttributes((0, lodash_1.get)(r, path)));
|
||||
return r;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Get server status.
|
||||
*/
|
||||
getStatus() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const query = `query {
|
||||
getStatus {
|
||||
version
|
||||
node {
|
||||
id
|
||||
network
|
||||
moniker
|
||||
}
|
||||
sync {
|
||||
latest_block_hash
|
||||
latest_block_height
|
||||
latest_block_time
|
||||
catching_up
|
||||
}
|
||||
validator {
|
||||
address
|
||||
voting_power
|
||||
}
|
||||
validators {
|
||||
address
|
||||
voting_power
|
||||
proposer_priority
|
||||
}
|
||||
num_peers
|
||||
peers {
|
||||
node {
|
||||
id
|
||||
network
|
||||
moniker
|
||||
}
|
||||
is_outbound
|
||||
remote_ip
|
||||
}
|
||||
disk_usage
|
||||
}
|
||||
}`;
|
||||
const { getStatus: status } = yield this._graph(query)();
|
||||
return status;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Fetch Accounts.
|
||||
*/
|
||||
getAccounts(addresses) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(addresses);
|
||||
(0, assert_1.default)(addresses.length);
|
||||
const query = `query ($addresses: [String!]) {
|
||||
getAccounts(addresses: $addresses) {
|
||||
address
|
||||
pubKey
|
||||
number
|
||||
sequence
|
||||
balance {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
addresses
|
||||
};
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'getAccounts');
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get records by ids.
|
||||
*/
|
||||
getRecordsByIds(ids, refs = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(ids);
|
||||
(0, assert_1.default)(ids.length);
|
||||
const query = `query ($ids: [String!]) {
|
||||
getRecordsByIds(ids: $ids) {
|
||||
id
|
||||
names
|
||||
owners
|
||||
bondId
|
||||
createTime
|
||||
expiryTime
|
||||
${attributeField}
|
||||
${refs ? refsField : ''}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
ids
|
||||
};
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'getRecordsByIds', RegistryClient.prepareAttributes('attributes'));
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
queryRecords(attributes, all = false, refs = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!attributes) {
|
||||
attributes = {};
|
||||
}
|
||||
const query = `query ($attributes: [KeyValueInput!], $all: Boolean) {
|
||||
queryRecords(attributes: $attributes, all: $all) {
|
||||
id
|
||||
names
|
||||
owners
|
||||
bondId
|
||||
createTime
|
||||
expiryTime
|
||||
${attributeField}
|
||||
${refs ? refsField : ''}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
attributes: util_1.Util.toGQLAttributes(attributes),
|
||||
all
|
||||
};
|
||||
let result = (yield this._graph(query)(variables))['queryRecords'];
|
||||
result = RegistryClient.prepareAttributes('attributes')(result);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Lookup authorities by names.
|
||||
*/
|
||||
lookupAuthorities(names, auction = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(names.length);
|
||||
const query = `query ($names: [String!]) {
|
||||
lookupAuthorities(names: $names) {
|
||||
ownerAddress
|
||||
ownerPublicKey
|
||||
height
|
||||
status
|
||||
bondId
|
||||
expiryTime
|
||||
${auction ? ('auction { ' + auctionFields + ' }') : ''}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
names
|
||||
};
|
||||
const result = yield this._graph(query)(variables);
|
||||
return result['lookupAuthorities'];
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get auctions by ids.
|
||||
*/
|
||||
getAuctionsByIds(ids) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(ids);
|
||||
(0, assert_1.default)(ids.length);
|
||||
const query = `query ($ids: [String!]) {
|
||||
getAuctionsByIds(ids: $ids) {
|
||||
${auctionFields}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
ids
|
||||
};
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'getAuctionsByIds');
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Lookup names.
|
||||
*/
|
||||
lookupNames(names, history = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(names.length);
|
||||
const query = `query ($names: [String!]) {
|
||||
lookupNames(names: $names) {
|
||||
latest {
|
||||
id
|
||||
height
|
||||
}
|
||||
${history ? historyFields : ''}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
names
|
||||
};
|
||||
const result = yield this._graph(query)(variables);
|
||||
return result['lookupNames'];
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Resolve names to records.
|
||||
*/
|
||||
resolveNames(names, refs = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(names.length);
|
||||
const query = `query ($names: [String!]) {
|
||||
resolveNames(names: $names) {
|
||||
id
|
||||
names
|
||||
owners
|
||||
bondId
|
||||
createTime
|
||||
expiryTime
|
||||
${attributeField}
|
||||
${refs ? refsField : ''}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
names
|
||||
};
|
||||
let result = (yield this._graph(query)(variables))['resolveNames'];
|
||||
result = RegistryClient.prepareAttributes('attributes')(result);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get bonds by ids.
|
||||
*/
|
||||
getBondsByIds(ids) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(ids);
|
||||
(0, assert_1.default)(ids.length);
|
||||
const query = `query ($ids: [String!]) {
|
||||
getBondsByIds(ids: $ids) {
|
||||
id
|
||||
owner
|
||||
balance {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
ids
|
||||
};
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'getBondsByIds');
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
queryBonds(attributes = {}) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const query = `query ($attributes: [KeyValueInput!]) {
|
||||
queryBonds(attributes: $attributes) {
|
||||
id
|
||||
owner
|
||||
balance {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}`;
|
||||
const variables = {
|
||||
attributes: util_1.Util.toGQLAttributes(attributes)
|
||||
};
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'queryBonds');
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Submit transaction.
|
||||
*/
|
||||
submit(tx) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
(0, assert_1.default)(tx);
|
||||
// Broadcast transaction.
|
||||
const { data } = yield axios_1.default.post(`${this._restEndpoint}${(0, provider_1.generateEndpointBroadcast)()}`, tx);
|
||||
return data;
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.RegistryClient = RegistryClient;
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema#",
|
||||
"id": "/Record",
|
||||
"type": "object"
|
||||
}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
import { Fee } from '@tharsis/transactions';
|
||||
import { Registry } from '../index';
|
||||
export declare const ensureUpdatedConfig: (path: string) => Promise<any>;
|
||||
export declare const getBaseConfig: (path: string) => Promise<any>;
|
||||
/**
|
||||
* Provision a bond for record registration.
|
||||
*/
|
||||
export declare const provisionBondId: (registry: Registry, privateKey: string, fee: Fee) => Promise<any>;
|
||||
export declare const getConfig: () => {
|
||||
chainId: string;
|
||||
privateKey: string;
|
||||
restEndpoint: string;
|
||||
gqlEndpoint: string;
|
||||
fee: {
|
||||
amount: string;
|
||||
denom: string;
|
||||
gas: string;
|
||||
};
|
||||
};
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getConfig = exports.provisionBondId = exports.getBaseConfig = exports.ensureUpdatedConfig = void 0;
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const node_yaml_1 = __importDefault(require("node-yaml"));
|
||||
const semver_1 = __importDefault(require("semver"));
|
||||
const ensureUpdatedConfig = (path) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const conf = yield node_yaml_1.default.read(path);
|
||||
conf.record.version = semver_1.default.inc(conf.record.version, 'patch');
|
||||
yield node_yaml_1.default.write(path, conf);
|
||||
return conf;
|
||||
});
|
||||
exports.ensureUpdatedConfig = ensureUpdatedConfig;
|
||||
const getBaseConfig = (path) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const conf = yield node_yaml_1.default.read(path);
|
||||
conf.record.version = '0.0.1';
|
||||
return conf;
|
||||
});
|
||||
exports.getBaseConfig = getBaseConfig;
|
||||
/**
|
||||
* Provision a bond for record registration.
|
||||
*/
|
||||
const provisionBondId = (registry, privateKey, fee) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
let bonds = yield registry.queryBonds();
|
||||
if (!bonds.length) {
|
||||
yield registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
|
||||
bonds = yield registry.queryBonds();
|
||||
}
|
||||
return bonds[0].id;
|
||||
});
|
||||
exports.provisionBondId = provisionBondId;
|
||||
const getConfig = () => {
|
||||
(0, assert_1.default)(process.env.PRIVATE_KEY);
|
||||
return {
|
||||
chainId: process.env.COSMOS_CHAIN_ID || 'laconic_9000-1',
|
||||
privateKey: process.env.PRIVATE_KEY,
|
||||
restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:1317',
|
||||
gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api',
|
||||
fee: {
|
||||
amount: '20',
|
||||
denom: 'aphoton',
|
||||
gas: '200000',
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.getConfig = getConfig;
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
import { Chain, Sender } from '@tharsis/transactions';
|
||||
import { Account } from './account';
|
||||
/**
|
||||
* Generate a cosmos-sdk transaction.
|
||||
*/
|
||||
export declare const createTransaction: (message: any, account: Account, sender: Sender, chain: Chain) => {
|
||||
message: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxRaw;
|
||||
path: string;
|
||||
};
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTransaction = void 0;
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const transactions_1 = require("@tharsis/transactions");
|
||||
/**
|
||||
* Generate a cosmos-sdk transaction.
|
||||
*/
|
||||
const createTransaction = (message, account, sender, chain) => {
|
||||
(0, assert_1.default)(message);
|
||||
(0, assert_1.default)(account);
|
||||
// Sign transaction.
|
||||
const signature = account.sign(message);
|
||||
let extension = (0, transactions_1.signatureToWeb3Extension)(chain, sender, signature);
|
||||
// Create the txRaw.
|
||||
return (0, transactions_1.createTxRawEIP712)(message.legacyAmino.body, message.legacyAmino.authInfo, extension);
|
||||
};
|
||||
exports.createTransaction = createTransaction;
|
||||
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Record.
|
||||
*/
|
||||
export declare class Record {
|
||||
_record: any;
|
||||
/**
|
||||
* New Record.
|
||||
*/
|
||||
constructor(record: any);
|
||||
get attributes(): string;
|
||||
/**
|
||||
* Serialize record.
|
||||
*/
|
||||
serialize(): {
|
||||
id: string;
|
||||
bond_id: string;
|
||||
create_time: string;
|
||||
expiry_time: string;
|
||||
deleted: boolean;
|
||||
attributes: string;
|
||||
};
|
||||
/**
|
||||
* Get message to calculate record signature.
|
||||
*/
|
||||
getMessageToSign(): any;
|
||||
}
|
||||
/**
|
||||
* Record Signature.
|
||||
*/
|
||||
export declare class Signature {
|
||||
_pubKey: string;
|
||||
_sig: string;
|
||||
/**
|
||||
* New Signature.
|
||||
*/
|
||||
constructor(pubKey: string, sig: string);
|
||||
/**
|
||||
* Serialize Signature.
|
||||
*/
|
||||
serialize(): any;
|
||||
}
|
||||
/**
|
||||
* Message Payload.
|
||||
*/
|
||||
export declare class Payload {
|
||||
_record: Record;
|
||||
_signatures: Signature[];
|
||||
/**
|
||||
* New Payload.
|
||||
*/
|
||||
constructor(record: Record, ...signatures: Signature[]);
|
||||
get record(): Record;
|
||||
get signatures(): Signature[];
|
||||
/**
|
||||
* Add message signature to payload.
|
||||
*/
|
||||
addSignature(signature: any): void;
|
||||
/**
|
||||
* Serialize Payload.
|
||||
*/
|
||||
serialize(): {
|
||||
record: {
|
||||
id: string;
|
||||
bond_id: string;
|
||||
create_time: string;
|
||||
expiry_time: string;
|
||||
deleted: boolean;
|
||||
attributes: string;
|
||||
};
|
||||
signatures: any[];
|
||||
};
|
||||
}
|
||||
Vendored
+114
@@ -0,0 +1,114 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Payload = exports.Signature = exports.Record = void 0;
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const jsonschema_1 = require("jsonschema");
|
||||
const record_json_1 = __importDefault(require("./schema/record.json"));
|
||||
const util_1 = require("./util");
|
||||
/**
|
||||
* Record.
|
||||
*/
|
||||
class Record {
|
||||
/**
|
||||
* New Record.
|
||||
*/
|
||||
constructor(record) {
|
||||
(0, assert_1.default)(record);
|
||||
const validator = new jsonschema_1.Validator();
|
||||
const result = validator.validate(record, record_json_1.default);
|
||||
if (!result.valid) {
|
||||
result.errors.map(console.error);
|
||||
throw new Error('Invalid record input.');
|
||||
}
|
||||
this._record = record;
|
||||
}
|
||||
get attributes() {
|
||||
return Buffer.from(JSON.stringify(this._record), 'binary').toString('base64');
|
||||
}
|
||||
/**
|
||||
* Serialize record.
|
||||
*/
|
||||
serialize() {
|
||||
return {
|
||||
'id': '_',
|
||||
'bond_id': '_',
|
||||
'create_time': '_',
|
||||
'expiry_time': '_',
|
||||
// Setting deleted as false (zero value) throws error in EIP712 signature verification.
|
||||
'deleted': true,
|
||||
'attributes': this.attributes,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Get message to calculate record signature.
|
||||
*/
|
||||
getMessageToSign() {
|
||||
return util_1.Util.sortJSON(this._record);
|
||||
}
|
||||
}
|
||||
exports.Record = Record;
|
||||
/**
|
||||
* Record Signature.
|
||||
*/
|
||||
class Signature {
|
||||
/**
|
||||
* New Signature.
|
||||
*/
|
||||
constructor(pubKey, sig) {
|
||||
(0, assert_1.default)(pubKey);
|
||||
(0, assert_1.default)(sig);
|
||||
this._pubKey = pubKey;
|
||||
this._sig = sig;
|
||||
}
|
||||
/**
|
||||
* Serialize Signature.
|
||||
*/
|
||||
serialize() {
|
||||
return util_1.Util.sortJSON({
|
||||
'pub_key': this._pubKey,
|
||||
'sig': this._sig
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.Signature = Signature;
|
||||
/**
|
||||
* Message Payload.
|
||||
*/
|
||||
class Payload {
|
||||
/**
|
||||
* New Payload.
|
||||
*/
|
||||
constructor(record, ...signatures) {
|
||||
(0, assert_1.default)(record);
|
||||
this._record = record;
|
||||
this._signatures = signatures;
|
||||
}
|
||||
get record() {
|
||||
return this._record;
|
||||
}
|
||||
get signatures() {
|
||||
return this._signatures;
|
||||
}
|
||||
/**
|
||||
* Add message signature to payload.
|
||||
*/
|
||||
addSignature(signature) {
|
||||
(0, assert_1.default)(signature);
|
||||
this._signatures.push(signature);
|
||||
}
|
||||
/**
|
||||
* Serialize Payload.
|
||||
*/
|
||||
serialize() {
|
||||
// return Util.sortJSON({
|
||||
// });
|
||||
return {
|
||||
'record': this._record.serialize(),
|
||||
'signatures': this._signatures.map(s => s.serialize())
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.Payload = Payload;
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
export declare class Util {
|
||||
/**
|
||||
* Sorts JSON object.
|
||||
*/
|
||||
static sortJSON(object: any): any;
|
||||
/**
|
||||
* Marshal object into gql 'attributes' variable.
|
||||
*/
|
||||
static toGQLAttributes(object: any): any[];
|
||||
/**
|
||||
* Unmarshal attributes array to object.
|
||||
*/
|
||||
static fromGQLAttributes(attributes?: any[]): {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* Get record content ID.
|
||||
*/
|
||||
static getContentId(record: any): Promise<string>;
|
||||
}
|
||||
Vendored
+145
@@ -0,0 +1,145 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __rest = (this && this.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Util = void 0;
|
||||
const Block = __importStar(require("multiformats/block"));
|
||||
const sha2_1 = require("multiformats/hashes/sha2");
|
||||
const dagCBOR = __importStar(require("@ipld/dag-cbor"));
|
||||
const dagJSON = __importStar(require("@ipld/dag-json"));
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
class Util {
|
||||
/**
|
||||
* Sorts JSON object.
|
||||
*/
|
||||
static sortJSON(object) {
|
||||
if (object instanceof Array) {
|
||||
for (let i = 0; i < object.length; i++) {
|
||||
object[i] = Util.sortJSON(object[i]);
|
||||
}
|
||||
return object;
|
||||
}
|
||||
if (typeof object !== 'object' || object === null)
|
||||
return object;
|
||||
let keys = Object.keys(object);
|
||||
keys = keys.sort();
|
||||
const newObject = {};
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
newObject[keys[i]] = Util.sortJSON(object[keys[i]]);
|
||||
}
|
||||
return newObject;
|
||||
}
|
||||
/**
|
||||
* Marshal object into gql 'attributes' variable.
|
||||
*/
|
||||
static toGQLAttributes(object) {
|
||||
const vars = [];
|
||||
Object.keys(object).forEach(key => {
|
||||
let type = typeof object[key];
|
||||
if (object[key] === null) {
|
||||
vars.push({ key, value: { 'null': true } });
|
||||
}
|
||||
else if (type === 'number') {
|
||||
type = (object[key] % 1 === 0) ? 'int' : 'float';
|
||||
vars.push({ key, value: { [type]: object[key] } });
|
||||
}
|
||||
else if (type === 'string') {
|
||||
vars.push({ key, value: { 'string': object[key] } });
|
||||
}
|
||||
else if (type === 'boolean') {
|
||||
vars.push({ key, value: { 'boolean': object[key] } });
|
||||
}
|
||||
else if (type === 'object') {
|
||||
const nestedObject = object[key];
|
||||
if (nestedObject['/'] !== undefined) {
|
||||
vars.push({ key, value: { 'reference': { id: nestedObject['/'] } } });
|
||||
}
|
||||
}
|
||||
});
|
||||
return vars;
|
||||
}
|
||||
/**
|
||||
* Unmarshal attributes array to object.
|
||||
*/
|
||||
static fromGQLAttributes(attributes = []) {
|
||||
const res = {};
|
||||
attributes.forEach(attr => {
|
||||
if (attr.value.null) {
|
||||
res[attr.key] = null;
|
||||
}
|
||||
else if (attr.value.json) {
|
||||
res[attr.key] = JSON.parse(attr.value.json);
|
||||
}
|
||||
else if (attr.value.reference) {
|
||||
// Convert GQL reference to IPLD style link.
|
||||
const ref = attr.value.reference;
|
||||
res[attr.key] = { '/': ref.id };
|
||||
}
|
||||
else {
|
||||
const _a = attr.value, { values, null: n } = _a, types = __rest(_a, ["values", "null"]);
|
||||
const value = Object.values(types).find(v => v !== null);
|
||||
res[attr.key] = value;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* Get record content ID.
|
||||
*/
|
||||
static getContentId(record) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const serialized = dagJSON.encode(record);
|
||||
const recordData = dagJSON.decode(serialized);
|
||||
const block = yield Block.encode({
|
||||
value: recordData,
|
||||
codec: dagCBOR,
|
||||
hasher: sha2_1.sha256
|
||||
});
|
||||
return block.cid.toString();
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.Util = Util;
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
exec "$@"
|
||||
|
||||
+11
-18
@@ -1,21 +1,20 @@
|
||||
{
|
||||
"name": "@cerc-io/laconic-sdk",
|
||||
"version": "0.1.6",
|
||||
"name": "laconic-client",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"repository": "git@github.com:cerc-io/laconic-sdk.git",
|
||||
"repository": "git@github.com:cerc-io/laconic-client.git",
|
||||
"author": "",
|
||||
"license": "UNLICENSED",
|
||||
"devDependencies": {
|
||||
"@types/is-url": "^1.2.30",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/lodash": "^4.14.181",
|
||||
"@types/semver": "^7.3.9",
|
||||
"@types/tiny-secp256k1": "1.0.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"google-protobuf": "^3.21.0",
|
||||
"jest": "29.0.0",
|
||||
"protoc-gen-ts": "^0.8.5",
|
||||
"ts-jest": "^29.0.2",
|
||||
"jest": "^27.5.1",
|
||||
"protoc-gen-ts": "^0.8.2",
|
||||
"ts-jest": "^27.1.3",
|
||||
"typescript": "^4.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -25,27 +24,21 @@
|
||||
"@ipld/dag-cbor": "^7.0.1",
|
||||
"@ipld/dag-json": "^8.0.9",
|
||||
"@metamask/eth-sig-util": "^4.0.0",
|
||||
"@tharsis/address-converter": "^0.1.7",
|
||||
"@tharsis/eip712": "^0.2.1",
|
||||
"@tharsis/proto": "^0.1.16",
|
||||
"@tharsis/provider": "^0.2.4",
|
||||
"@tharsis/transactions": "^0.2.2",
|
||||
"axios": "^0.26.1",
|
||||
"bip32": "3.0.1",
|
||||
"bip32": "^3.0.1",
|
||||
"bip39": "^3.0.4",
|
||||
"canonical-json": "^0.0.4",
|
||||
"ethers": "^5.6.2",
|
||||
"evmosjs": "^0.2.5",
|
||||
"graphql.js": "^0.6.8",
|
||||
"is-url": "^1.2.4",
|
||||
"js-sha256": "^0.9.0",
|
||||
"js-yaml": "^3.14.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsonschema": "^1.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
"multiformats": "^9.5.4",
|
||||
"node-yaml": "^4.0.1",
|
||||
"secp256k1": "^4.0.1",
|
||||
"semver": "^7.3.5",
|
||||
"tiny-secp256k1": "^1.1.6"
|
||||
"tiny-secp256k1": "^2.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest --runInBand --verbose",
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.nameservice.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/nameservice/v1beta1/nameservice.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
|
||||
|
||||
// GenesisState defines the nameservice module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the params of nameservice module.
|
||||
Params params = 1 [
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
// records
|
||||
repeated Record records = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"records\" yaml:\"records\""
|
||||
];
|
||||
// authorities
|
||||
repeated AuthorityEntry authorities = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""
|
||||
];
|
||||
// names
|
||||
repeated NameEntry names = 4 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"names\" yaml:\"names\""
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.nameservice.v1beta1;
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
|
||||
|
||||
// Params defines the nameservice module parameters
|
||||
message Params {
|
||||
cosmos.base.v1beta1.Coin record_rent = 1 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""
|
||||
];
|
||||
google.protobuf.Duration record_rent_duration = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_rent = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""
|
||||
];
|
||||
google.protobuf.Duration authority_rent_duration = 4 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\""
|
||||
];
|
||||
google.protobuf.Duration authority_grace_period = 5 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\""
|
||||
];
|
||||
bool authority_auction_enabled = 6 [
|
||||
(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""
|
||||
];
|
||||
google.protobuf.Duration authority_auction_commits_duration = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\""
|
||||
];
|
||||
google.protobuf.Duration authority_auction_reveals_duration = 8 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\""
|
||||
];
|
||||
}
|
||||
|
||||
// Params defines the nameservice module records
|
||||
message Record {
|
||||
string id = 1 [
|
||||
(gogoproto.moretags) = "json:\"id\" yaml:\"id\""
|
||||
];
|
||||
string bond_id = 2 [
|
||||
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
|
||||
];
|
||||
string create_time = 3 [
|
||||
(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""
|
||||
];
|
||||
string expiry_time = 4 [
|
||||
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
|
||||
];
|
||||
bool deleted = 5;
|
||||
repeated string owners = 6 [
|
||||
(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""
|
||||
];
|
||||
string attributes = 7 [
|
||||
(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""
|
||||
];
|
||||
repeated string names = 8 [
|
||||
(gogoproto.moretags) = "json:\"names\" yaml:\"names\""
|
||||
];
|
||||
}
|
||||
|
||||
// AuthorityEntry defines the nameservice module AuthorityEntries
|
||||
message AuthorityEntry{
|
||||
string name = 1;
|
||||
NameAuthority entry = 2;
|
||||
}
|
||||
|
||||
// NameAuthority
|
||||
message NameAuthority {
|
||||
// Owner public key.
|
||||
string owner_public_key = 1 [
|
||||
(gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\""
|
||||
];
|
||||
// Owner address.
|
||||
string owner_address = 2 [
|
||||
(gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\""
|
||||
];
|
||||
// height at which name/authority was created.
|
||||
uint64 height = 3;
|
||||
string status = 4;
|
||||
string auction_id = 5 [
|
||||
(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""
|
||||
];
|
||||
string bond_id = 6 [
|
||||
(gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\""
|
||||
];
|
||||
google.protobuf.Timestamp expiry_time = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdtime) = true,
|
||||
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
|
||||
];
|
||||
}
|
||||
|
||||
// NameEntry
|
||||
message NameEntry{
|
||||
string name = 1;
|
||||
NameRecord entry = 2;
|
||||
}
|
||||
|
||||
// NameRecord
|
||||
message NameRecord {
|
||||
NameRecordEntry latest = 1;
|
||||
repeated NameRecordEntry history = 2;
|
||||
}
|
||||
|
||||
// NameRecordEntry
|
||||
message NameRecordEntry{
|
||||
string id = 1;
|
||||
uint64 height = 2;
|
||||
}
|
||||
|
||||
// Signature
|
||||
message Signature{
|
||||
string sig = 1 [
|
||||
(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""
|
||||
];
|
||||
string pub_key = 2 [
|
||||
(gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\""
|
||||
];
|
||||
}
|
||||
|
||||
// BlockChangeSet
|
||||
message BlockChangeSet{
|
||||
int64 height = 1;
|
||||
repeated string records = 2;
|
||||
repeated string auctions = 3;
|
||||
repeated AuctionBidInfo auction_bids = 4 [
|
||||
(gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\""
|
||||
];
|
||||
repeated string authorities = 5;
|
||||
repeated string names = 6;
|
||||
}
|
||||
|
||||
// AuctionBidInfo
|
||||
message AuctionBidInfo {
|
||||
string auction_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""
|
||||
];
|
||||
string bidder_address = 2 [
|
||||
(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.nameservice.v1beta1;
|
||||
|
||||
import "vulcanize/nameservice/v1beta1/nameservice.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
|
||||
|
||||
// Query defines the gRPC querier service for nameservice module
|
||||
service Query {
|
||||
// Params queries the nameservice module params.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/params";
|
||||
}
|
||||
// List records
|
||||
rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records";
|
||||
}
|
||||
// Get record by id
|
||||
rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records/{id}";
|
||||
}
|
||||
// Get records by bond id
|
||||
rpc GetRecordByBondId(QueryRecordByBondIdRequest) returns (QueryRecordByBondIdResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}";
|
||||
}
|
||||
// Get nameservice module balance
|
||||
rpc GetNameServiceModuleBalance(GetNameServiceModuleBalanceRequest) returns (GetNameServiceModuleBalanceResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/balance";
|
||||
}
|
||||
// List name records
|
||||
rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/names";
|
||||
}
|
||||
// Whois method retrieve the name authority info
|
||||
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/whois/{name}";
|
||||
}
|
||||
// LookupCrn
|
||||
rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/lookup";
|
||||
}
|
||||
// ResolveCrn
|
||||
rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/resolve";
|
||||
}
|
||||
// GetRecordExpiryQueue
|
||||
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/record-expiry";
|
||||
}
|
||||
// GetAuthorityExpiryQueue
|
||||
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse){
|
||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/authority-expiry";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request type for nameservice params
|
||||
message QueryParamsRequest{
|
||||
}
|
||||
|
||||
// QueryParamsResponse is response type for nameservice params
|
||||
message QueryParamsResponse{
|
||||
Params params = 1;
|
||||
}
|
||||
|
||||
// QueryListRecordsRequest is request type for nameservice records list
|
||||
message QueryListRecordsRequest{
|
||||
message ReferenceInput {
|
||||
string id = 1;
|
||||
}
|
||||
message ValueInput {
|
||||
string type = 1;
|
||||
string string = 2;
|
||||
int64 int = 3;
|
||||
double float = 4;
|
||||
bool boolean = 5;
|
||||
ReferenceInput reference = 6;
|
||||
repeated ValueInput values = 7;
|
||||
}
|
||||
message KeyValueInput {
|
||||
string key = 1;
|
||||
ValueInput value = 2;
|
||||
}
|
||||
repeated KeyValueInput attributes = 1;
|
||||
|
||||
bool all = 2;
|
||||
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
||||
}
|
||||
|
||||
// QueryListRecordsResponse is response type for nameservice records list
|
||||
message QueryListRecordsResponse{
|
||||
repeated Record records = 1 [
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
//QueryRecordByIdRequest is request type for nameservice records by id
|
||||
message QueryRecordByIdRequest{
|
||||
string id = 1 ;
|
||||
}
|
||||
|
||||
// QueryRecordByIdResponse is response type for nameservice records by id
|
||||
message QueryRecordByIdResponse{
|
||||
Record record = 1[
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
// QueryRecordByBondIdRequest is request type for get the records by bond-id
|
||||
message QueryRecordByBondIdRequest{
|
||||
string id = 1;
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||
}
|
||||
|
||||
// QueryRecordByBondIdResponse is response type for records list by bond-id
|
||||
message QueryRecordByBondIdResponse{
|
||||
repeated Record records = 1 [
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance
|
||||
message GetNameServiceModuleBalanceRequest{
|
||||
}
|
||||
|
||||
// GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance
|
||||
message GetNameServiceModuleBalanceResponse{
|
||||
repeated AccountBalance balances = 1;
|
||||
}
|
||||
|
||||
// AccountBalance is nameservice module account balance
|
||||
message AccountBalance {
|
||||
string account_name = 1 [
|
||||
(gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\""
|
||||
];
|
||||
repeated cosmos.base.v1beta1.Coin balance = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
||||
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
|
||||
];
|
||||
}
|
||||
|
||||
// QueryListNameRecordsRequest is request type for nameservice names records
|
||||
message QueryListNameRecordsRequest{
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryListNameRecordsResponse is response type for nameservice names records
|
||||
message QueryListNameRecordsResponse{
|
||||
repeated NameEntry names = 1 [
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryWhoisRequest is request type for Get NameAuthority
|
||||
message QueryWhoisRequest{
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// QueryWhoisResponse is response type for whois request
|
||||
message QueryWhoisResponse{
|
||||
NameAuthority name_authority = 1 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\""
|
||||
];
|
||||
}
|
||||
|
||||
// QueryLookupCrn is request type for LookupCrn
|
||||
message QueryLookupCrn{
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryLookupCrnResponse is response type for QueryLookupCrn
|
||||
message QueryLookupCrnResponse{
|
||||
NameRecord name = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrn is request type for ResolveCrn
|
||||
message QueryResolveCrn{
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrnResponse is response type for QueryResolveCrn
|
||||
message QueryResolveCrnResponse{
|
||||
Record record = 1;
|
||||
}
|
||||
|
||||
// QueryGetRecordExpiryQueue
|
||||
message QueryGetRecordExpiryQueue{
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryGetRecordExpiryQueueResponse
|
||||
message QueryGetRecordExpiryQueueResponse{
|
||||
repeated ExpiryQueueRecord records = 1;
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// ExpiryQueueRecord
|
||||
message ExpiryQueueRecord{
|
||||
string id = 1;
|
||||
repeated string value = 2;
|
||||
}
|
||||
|
||||
// QueryGetAuthorityExpiryQueue
|
||||
message QueryGetAuthorityExpiryQueue{
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryGetAuthorityExpiryQueueResponse
|
||||
message QueryGetAuthorityExpiryQueueResponse{
|
||||
repeated ExpiryQueueRecord authorities = 1;
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.nameservice.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/nameservice/v1beta1/nameservice.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
|
||||
|
||||
// Msg
|
||||
service Msg {
|
||||
// SetRecord will records a new record with given payload and bond id
|
||||
rpc SetRecord(MsgSetRecord) returns(MsgSetRecordResponse){}
|
||||
// Renew Record will renew the expire record
|
||||
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse){}
|
||||
// AssociateBond
|
||||
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse){}
|
||||
// DissociateBond
|
||||
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse){}
|
||||
// DissociateRecords
|
||||
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse){}
|
||||
// ReAssociateRecords
|
||||
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse){}
|
||||
// SetName will store the name with given crn and name
|
||||
rpc SetName(MsgSetName) returns (MsgSetNameResponse){}
|
||||
// Reserve name
|
||||
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse){}
|
||||
// Delete Name method will remove authority name
|
||||
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse){}
|
||||
// SetAuthorityBond
|
||||
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse){}
|
||||
}
|
||||
|
||||
// MsgSetRecord
|
||||
message MsgSetRecord{
|
||||
string bond_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
|
||||
];
|
||||
string signer = 2;
|
||||
Payload payload = 3 [
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
// MsgSetRecordResponse
|
||||
message MsgSetRecordResponse{
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// Payload
|
||||
message Payload {
|
||||
Record record = 1;
|
||||
repeated Signature signatures = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""
|
||||
];
|
||||
}
|
||||
|
||||
// MsgSetName
|
||||
message MsgSetName{
|
||||
string crn = 1;
|
||||
string cid = 2;
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetNameResponse
|
||||
message MsgSetNameResponse{
|
||||
}
|
||||
|
||||
// MsgReserveName
|
||||
message MsgReserveAuthority{
|
||||
string name = 1;
|
||||
string signer = 2;
|
||||
// if creating a sub-authority.
|
||||
string owner = 3;
|
||||
}
|
||||
|
||||
// MsgReserveNameResponse
|
||||
message MsgReserveAuthorityResponse{
|
||||
}
|
||||
|
||||
// MsgSetAuthorityBond is SDK message for SetAuthorityBond
|
||||
message MsgSetAuthorityBond{
|
||||
string name = 1;
|
||||
string bond_id = 2 [
|
||||
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
|
||||
];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetAuthorityBondResponse
|
||||
message MsgSetAuthorityBondResponse{
|
||||
}
|
||||
|
||||
// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority
|
||||
message MsgDeleteNameAuthority{
|
||||
string crn = 1;
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDeleteNameAuthorityResponse
|
||||
message MsgDeleteNameAuthorityResponse{
|
||||
}
|
||||
|
||||
//MsgRenewRecord is SDK message for Renew a record
|
||||
message MsgRenewRecord{
|
||||
string record_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""
|
||||
];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgRenewRecordResponse
|
||||
message MsgRenewRecordResponse{
|
||||
}
|
||||
|
||||
// MsgAssociateBond
|
||||
message MsgAssociateBond{
|
||||
string record_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""
|
||||
];
|
||||
string bond_id = 2 [
|
||||
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
|
||||
];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgAssociateBondResponse
|
||||
message MsgAssociateBondResponse{
|
||||
}
|
||||
|
||||
// MsgDissociateBond is SDK message for Msg/DissociateBond
|
||||
message MsgDissociateBond{
|
||||
string record_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""
|
||||
];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateBondResponse is response type for MsgDissociateBond
|
||||
message MsgDissociateBondResponse{
|
||||
}
|
||||
|
||||
// MsgDissociateRecords is SDK message for Msg/DissociateRecords
|
||||
message MsgDissociateRecords{
|
||||
string bond_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
|
||||
];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateRecordsResponse is response type for MsgDissociateRecords
|
||||
message MsgDissociateRecordsResponse{
|
||||
}
|
||||
|
||||
// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords
|
||||
message MsgReAssociateRecords{
|
||||
string new_bond_id = 1 [
|
||||
(gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\""
|
||||
];
|
||||
string old_bond_id = 2 [
|
||||
(gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\""
|
||||
];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords
|
||||
message MsgReAssociateRecordsResponse{
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
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\""];
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/registry/v1beta1/registry.proto";
|
||||
|
||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||
|
||||
// GenesisState defines the registry module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the params of registry module.
|
||||
Params params = 1 [(gogoproto.nullable) = false];
|
||||
// records
|
||||
repeated Record records = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"records\" yaml:\"records\""];
|
||||
// authorities
|
||||
repeated AuthorityEntry authorities = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""];
|
||||
// names
|
||||
repeated NameEntry names = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "vulcanize/registry/v1beta1/registry.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||
|
||||
// Query defines the gRPC querier service for registry module
|
||||
service Query {
|
||||
// Params queries the registry module params.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/params";
|
||||
}
|
||||
// List records
|
||||
rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/records";
|
||||
}
|
||||
// Get record by id
|
||||
rpc GetRecord(QueryRecordByIDRequest) returns (QueryRecordByIDResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/records/{id}";
|
||||
}
|
||||
// Get records by bond id
|
||||
rpc GetRecordByBondID(QueryRecordByBondIDRequest) returns (QueryRecordByBondIDResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/records-by-bond-id/{id}";
|
||||
}
|
||||
// Get registry module balance
|
||||
rpc GetRegistryModuleBalance(GetRegistryModuleBalanceRequest) returns (GetRegistryModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/balance";
|
||||
}
|
||||
// List name records
|
||||
rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/names";
|
||||
}
|
||||
// Whois method retrieve the name authority info
|
||||
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/whois/{name}";
|
||||
}
|
||||
// LookupCrn
|
||||
rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/lookup";
|
||||
}
|
||||
// ResolveCrn
|
||||
rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/resolve";
|
||||
}
|
||||
// GetRecordExpiryQueue
|
||||
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/record-expiry";
|
||||
}
|
||||
// GetAuthorityExpiryQueue
|
||||
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/authority-expiry";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request type for registry params
|
||||
message QueryParamsRequest {}
|
||||
|
||||
// QueryParamsResponse is response type for registry params
|
||||
message QueryParamsResponse {
|
||||
Params params = 1;
|
||||
}
|
||||
|
||||
// QueryListRecordsRequest is request type for registry records list
|
||||
message QueryListRecordsRequest {
|
||||
message ReferenceInput {
|
||||
string id = 1;
|
||||
}
|
||||
message ValueInput {
|
||||
string type = 1;
|
||||
string string = 2;
|
||||
int64 int = 3;
|
||||
double float = 4;
|
||||
bool boolean = 5;
|
||||
ReferenceInput reference = 6;
|
||||
repeated ValueInput values = 7;
|
||||
}
|
||||
message KeyValueInput {
|
||||
string key = 1;
|
||||
ValueInput value = 2;
|
||||
}
|
||||
repeated KeyValueInput attributes = 1;
|
||||
|
||||
bool all = 2;
|
||||
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
||||
}
|
||||
|
||||
// QueryListRecordsResponse is response type for registry records list
|
||||
message QueryListRecordsResponse {
|
||||
repeated Record records = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryRecordByIDRequest is request type for registry records by id
|
||||
message QueryRecordByIDRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// QueryRecordByIDResponse is response type for registry records by id
|
||||
message QueryRecordByIDResponse {
|
||||
Record record = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// QueryRecordByBondIdRequest is request type for get the records by bond-id
|
||||
message QueryRecordByBondIDRequest {
|
||||
string id = 1;
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||
}
|
||||
|
||||
// QueryRecordByBondIdResponse is response type for records list by bond-id
|
||||
message QueryRecordByBondIDResponse {
|
||||
repeated Record records = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// GetRegistryModuleBalanceRequest is request type for registry module accounts balance
|
||||
message GetRegistryModuleBalanceRequest {}
|
||||
|
||||
// GetRegistryModuleBalanceResponse is response type for registry module accounts balance
|
||||
message GetRegistryModuleBalanceResponse {
|
||||
repeated AccountBalance balances = 1;
|
||||
}
|
||||
|
||||
// AccountBalance is registry module account balance
|
||||
message AccountBalance {
|
||||
string account_name = 1 [(gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\""];
|
||||
repeated cosmos.base.v1beta1.Coin balance = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
||||
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
|
||||
];
|
||||
}
|
||||
|
||||
// QueryListNameRecordsRequest is request type for registry names records
|
||||
message QueryListNameRecordsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryListNameRecordsResponse is response type for registry names records
|
||||
message QueryListNameRecordsResponse {
|
||||
repeated NameEntry names = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryWhoisRequest is request type for Get NameAuthority
|
||||
message QueryWhoisRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// QueryWhoisResponse is response type for whois request
|
||||
message QueryWhoisResponse {
|
||||
NameAuthority name_authority = 1
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\""];
|
||||
}
|
||||
|
||||
// QueryLookupCrn is request type for LookupCrn
|
||||
message QueryLookupCrn {
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryLookupCrnResponse is response type for QueryLookupCrn
|
||||
message QueryLookupCrnResponse {
|
||||
NameRecord name = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrn is request type for ResolveCrn
|
||||
message QueryResolveCrn {
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrnResponse is response type for QueryResolveCrn
|
||||
message QueryResolveCrnResponse {
|
||||
Record record = 1;
|
||||
}
|
||||
|
||||
// QueryGetRecordExpiryQueue
|
||||
message QueryGetRecordExpiryQueue {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryGetRecordExpiryQueueResponse
|
||||
message QueryGetRecordExpiryQueueResponse {
|
||||
repeated ExpiryQueueRecord records = 1;
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// ExpiryQueueRecord
|
||||
message ExpiryQueueRecord {
|
||||
string id = 1;
|
||||
repeated string value = 2;
|
||||
}
|
||||
|
||||
// QueryGetAuthorityExpiryQueue
|
||||
message QueryGetAuthorityExpiryQueue {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryGetAuthorityExpiryQueueResponse
|
||||
message QueryGetAuthorityExpiryQueueResponse {
|
||||
repeated ExpiryQueueRecord authorities = 1;
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||
|
||||
// Params defines the registry module parameters
|
||||
message Params {
|
||||
cosmos.base.v1beta1.Coin record_rent = 1
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""];
|
||||
google.protobuf.Duration record_rent_duration = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_rent = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""];
|
||||
google.protobuf.Duration authority_rent_duration = 4 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\""
|
||||
];
|
||||
google.protobuf.Duration authority_grace_period = 5 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\""
|
||||
];
|
||||
bool authority_auction_enabled = 6
|
||||
[(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""];
|
||||
google.protobuf.Duration authority_auction_commits_duration = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\""
|
||||
];
|
||||
google.protobuf.Duration authority_auction_reveals_duration = 8 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\""
|
||||
];
|
||||
cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\""
|
||||
];
|
||||
}
|
||||
|
||||
// Params defines the registry module records
|
||||
message Record {
|
||||
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||
string create_time = 3 [(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""];
|
||||
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""];
|
||||
bool deleted = 5;
|
||||
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
|
||||
google.protobuf.Any attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
|
||||
repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
|
||||
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
||||
}
|
||||
|
||||
// AuthorityEntry defines the registry module AuthorityEntries
|
||||
message AuthorityEntry {
|
||||
string name = 1;
|
||||
NameAuthority entry = 2;
|
||||
}
|
||||
|
||||
// NameAuthority
|
||||
message NameAuthority {
|
||||
// Owner public key.
|
||||
string owner_public_key = 1 [(gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\""];
|
||||
// Owner address.
|
||||
string owner_address = 2 [(gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\""];
|
||||
// height at which name/authority was created.
|
||||
uint64 height = 3;
|
||||
string status = 4;
|
||||
string auction_id = 5 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
||||
string bond_id = 6 [(gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\""];
|
||||
google.protobuf.Timestamp expiry_time = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdtime) = true,
|
||||
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
|
||||
];
|
||||
}
|
||||
|
||||
// NameEntry
|
||||
message NameEntry {
|
||||
string name = 1;
|
||||
NameRecord entry = 2;
|
||||
}
|
||||
|
||||
// NameRecord
|
||||
message NameRecord {
|
||||
NameRecordEntry latest = 1;
|
||||
repeated NameRecordEntry history = 2;
|
||||
}
|
||||
|
||||
// NameRecordEntry
|
||||
message NameRecordEntry {
|
||||
string id = 1;
|
||||
uint64 height = 2;
|
||||
}
|
||||
|
||||
// Signature
|
||||
message Signature {
|
||||
string sig = 1 [(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""];
|
||||
string pub_key = 2 [(gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\""];
|
||||
}
|
||||
|
||||
// BlockChangeSet
|
||||
message BlockChangeSet {
|
||||
int64 height = 1;
|
||||
repeated string records = 2;
|
||||
repeated string auctions = 3;
|
||||
repeated AuctionBidInfo auction_bids = 4 [(gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\""];
|
||||
repeated string authorities = 5;
|
||||
repeated string names = 6;
|
||||
}
|
||||
|
||||
// AuctionBidInfo
|
||||
message AuctionBidInfo {
|
||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
||||
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/registry/v1beta1/registry.proto";
|
||||
|
||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||
|
||||
// Msg
|
||||
service Msg {
|
||||
// SetRecord will records a new record with given payload and bond id
|
||||
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {}
|
||||
// Renew Record will renew the expire record
|
||||
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {}
|
||||
// AssociateBond
|
||||
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {}
|
||||
// DissociateBond
|
||||
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {}
|
||||
// DissociateRecords
|
||||
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {}
|
||||
// ReAssociateRecords
|
||||
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {}
|
||||
// SetName will store the name with given crn and name
|
||||
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {}
|
||||
// Reserve name
|
||||
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {}
|
||||
// Delete Name method will remove authority name
|
||||
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {}
|
||||
// SetAuthorityBond
|
||||
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {}
|
||||
}
|
||||
|
||||
// MsgSetRecord
|
||||
message MsgSetRecord {
|
||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||
string signer = 2;
|
||||
Payload payload = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// MsgSetRecordResponse
|
||||
message MsgSetRecordResponse {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// Payload
|
||||
message Payload {
|
||||
Record record = 1;
|
||||
repeated Signature signatures = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""];
|
||||
}
|
||||
|
||||
// MsgSetName
|
||||
message MsgSetName {
|
||||
string crn = 1;
|
||||
string cid = 2;
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetNameResponse
|
||||
message MsgSetNameResponse {}
|
||||
|
||||
// MsgReserveName
|
||||
message MsgReserveAuthority {
|
||||
string name = 1;
|
||||
string signer = 2;
|
||||
// if creating a sub-authority.
|
||||
string owner = 3;
|
||||
}
|
||||
|
||||
// MsgReserveNameResponse
|
||||
message MsgReserveAuthorityResponse {}
|
||||
|
||||
// MsgSetAuthorityBond is SDK message for SetAuthorityBond
|
||||
message MsgSetAuthorityBond {
|
||||
string name = 1;
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetAuthorityBondResponse
|
||||
message MsgSetAuthorityBondResponse {}
|
||||
|
||||
// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority
|
||||
message MsgDeleteNameAuthority {
|
||||
string crn = 1;
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDeleteNameAuthorityResponse
|
||||
message MsgDeleteNameAuthorityResponse {}
|
||||
|
||||
// MsgRenewRecord is SDK message for Renew a record
|
||||
message MsgRenewRecord {
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgRenewRecordResponse
|
||||
message MsgRenewRecordResponse {}
|
||||
|
||||
// MsgAssociateBond
|
||||
message MsgAssociateBond {
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgAssociateBondResponse
|
||||
message MsgAssociateBondResponse {}
|
||||
|
||||
// MsgDissociateBond is SDK message for Msg/DissociateBond
|
||||
message MsgDissociateBond {
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateBondResponse is response type for MsgDissociateBond
|
||||
message MsgDissociateBondResponse {}
|
||||
|
||||
// MsgDissociateRecords is SDK message for Msg/DissociateRecords
|
||||
message MsgDissociateRecords {
|
||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateRecordsResponse is response type for MsgDissociateRecords
|
||||
message MsgDissociateRecordsResponse {}
|
||||
|
||||
// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords
|
||||
message MsgReAssociateRecords {
|
||||
string new_bond_id = 1 [(gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\""];
|
||||
string old_bond_id = 2 [(gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords
|
||||
message MsgReAssociateRecordsResponse {}
|
||||
@@ -166,10 +166,6 @@ export class Account {
|
||||
assert(message);
|
||||
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({
|
||||
data: {
|
||||
types: message.eipToSign.types as MessageTypes,
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ const auctionTests = (numBidders = 3) => {
|
||||
beforeAll(async () => {
|
||||
console.log('Running auction tests with num bidders', numBidders);
|
||||
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(restEndpoint, gqlEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Setup bidder accounts', async () => {
|
||||
|
||||
+69
-85
@@ -12,130 +12,114 @@ jest.setTimeout(90 * 1000);
|
||||
const bondTests = () => {
|
||||
let registry: Registry;
|
||||
|
||||
let watcher: any;
|
||||
|
||||
let version1: string;
|
||||
let version2: string;
|
||||
|
||||
let bondId1: string;
|
||||
let bondId2: string;
|
||||
|
||||
let bondOwner: string;
|
||||
|
||||
const publishNewWatcherVersion = async (bondId: string) => {
|
||||
let watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||
await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee);
|
||||
return watcher;
|
||||
return watcher.record.version;
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(restEndpoint, gqlEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Create bond.', async () => {
|
||||
let bondId = await registry.getNextBondId(privateKey);
|
||||
expect(bondId).toBeDefined();
|
||||
bondId1 = await registry.getNextBondId(privateKey);
|
||||
expect(bondId1).toBeDefined();
|
||||
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
|
||||
})
|
||||
|
||||
test('Get bond by ID.', async () => {
|
||||
const [bond] = await registry.getBondsByIds([bondId1]);
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.id).toBe(bondId1);
|
||||
expect(bond.balance).toHaveLength(1);
|
||||
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
|
||||
bondOwner = bond.owner;
|
||||
});
|
||||
|
||||
describe('With bond created', () => {
|
||||
let bond1: any
|
||||
test('Query bonds.', async () => {
|
||||
const bonds = await registry.queryBonds();
|
||||
expect(bonds).toBeDefined();
|
||||
const bond = bonds.filter((bond: any) => bond.id === bondId1);
|
||||
expect(bond).toBeDefined();
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
let bondId1 = await registry.getNextBondId(privateKey);
|
||||
expect(bondId1).toBeDefined();
|
||||
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
|
||||
test('Query bonds by owner.', async () => {
|
||||
const bonds = await registry.queryBonds({ owner: bondOwner });
|
||||
expect(bonds).toBeDefined();
|
||||
const bond = bonds.filter((bond: any) => bond.id === bondId1);
|
||||
expect(bond).toBeDefined();
|
||||
});
|
||||
|
||||
[bond1] = await registry.getBondsByIds([bondId1]);
|
||||
expect(bond1).toBeDefined();
|
||||
expect(bond1.id).toEqual(bondId1);
|
||||
});
|
||||
test('Refill bond.', async () => {
|
||||
await registry.refillBond({ id: bondId1, denom: 'aphoton', amount: '500' }, privateKey, fee);
|
||||
|
||||
test('Get bond by ID.', async () => {
|
||||
const [bond] = await registry.getBondsByIds([bond1.id]);
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.id).toBe(bond1.id);
|
||||
expect(bond.balance).toHaveLength(1);
|
||||
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
|
||||
});
|
||||
const [bond] = await registry.getBondsByIds([bondId1]);
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.id).toBe(bondId1);
|
||||
expect(bond.balance).toHaveLength(1);
|
||||
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000500' });
|
||||
});
|
||||
|
||||
test('Query bonds.', async () => {
|
||||
const bonds = await registry.queryBonds();
|
||||
expect(bonds).toBeDefined();
|
||||
const bond = bonds.filter((bond: any) => bond.id === bond1.id);
|
||||
expect(bond).toBeDefined();
|
||||
});
|
||||
test('Withdraw bond.', async () => {
|
||||
await registry.withdrawBond({ id: bondId1, denom: 'aphoton', amount: '500' }, privateKey, fee);
|
||||
|
||||
test('Query bonds by owner.', async () => {
|
||||
const bonds = await registry.queryBonds({ owner: bond1.owner });
|
||||
expect(bonds).toBeDefined();
|
||||
const bond = bonds.filter((bond: any) => bond.id === bond1.id);
|
||||
expect(bond).toBeDefined();
|
||||
});
|
||||
const [bond] = await registry.getBondsByIds([bondId1]);
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.id).toBe(bondId1);
|
||||
expect(bond.balance).toHaveLength(1);
|
||||
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
|
||||
});
|
||||
|
||||
test('Refill bond.', async () => {
|
||||
await registry.refillBond({ id: bond1.id, denom: 'aphoton', amount: '500' }, privateKey, fee);
|
||||
|
||||
const [bond] = await registry.getBondsByIds([bond1.id]);
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.id).toBe(bond1.id);
|
||||
expect(bond.balance).toHaveLength(1);
|
||||
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000500' });
|
||||
});
|
||||
|
||||
test('Withdraw bond.', async () => {
|
||||
await registry.withdrawBond({ id: bond1.id, denom: 'aphoton', amount: '500' }, privateKey, fee);
|
||||
|
||||
const [bond] = await registry.getBondsByIds([bond1.id]);
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.id).toBe(bond1.id);
|
||||
expect(bond.balance).toHaveLength(1);
|
||||
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
|
||||
});
|
||||
|
||||
test('Cancel bond.', async () => {
|
||||
await registry.cancelBond({ id: bond1.id }, privateKey, fee);
|
||||
|
||||
const [bond] = await registry.getBondsByIds([bond1.id]);
|
||||
expect(bond.id).toBe("");
|
||||
expect(bond.owner).toBe("");
|
||||
expect(bond.balance).toHaveLength(0);
|
||||
});
|
||||
test('Cancel bond.', async () => {
|
||||
await registry.cancelBond({ id: bondId1 }, privateKey, fee);
|
||||
|
||||
const [bond] = await registry.getBondsByIds([bondId1]);
|
||||
expect(bond.id).toBe("");
|
||||
expect(bond.owner).toBe("");
|
||||
expect(bond.balance).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('Associate/Dissociate bond.', async () => {
|
||||
let bondId1: string;
|
||||
|
||||
bondId1 = await registry.getNextBondId(privateKey);
|
||||
expect(bondId1).toBeDefined();
|
||||
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
|
||||
|
||||
// Create a new record.
|
||||
let watcher = await publishNewWatcherVersion(bondId1);
|
||||
let query = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
|
||||
let [record1] = await registry.queryRecords(query, true);
|
||||
version1 = await publishNewWatcherVersion(bondId1);
|
||||
let [record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true);
|
||||
expect(record1.bondId).toBe(bondId1);
|
||||
|
||||
// Dissociate record, query and confirm.
|
||||
await registry.dissociateBond({ recordId: record1.id }, privateKey, fee);
|
||||
[record1] = await registry.queryRecords(query, true);
|
||||
[record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true);
|
||||
expect(record1.bondId).toBe('');
|
||||
|
||||
// Associate record with bond, query and confirm.
|
||||
await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, fee);
|
||||
[record1] = await registry.queryRecords(query, true);
|
||||
[record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true);
|
||||
expect(record1.bondId).toBe(bondId1);
|
||||
});
|
||||
|
||||
test('Reassociate/Dissociate records.', async () => {
|
||||
let bondId1: string;
|
||||
let bondId2: string;
|
||||
|
||||
bondId1 = await registry.getNextBondId(privateKey);
|
||||
expect(bondId1).toBeDefined();
|
||||
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
|
||||
|
||||
// Create a new record version.
|
||||
let watcher = await publishNewWatcherVersion(bondId1);
|
||||
let queryv1 = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
|
||||
let queryv2 = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
|
||||
version2 = await publishNewWatcherVersion(bondId1);
|
||||
|
||||
// Check version1, version2 as associated with bondId1.
|
||||
let records;
|
||||
records = await registry.queryRecords(queryv1, true);
|
||||
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true);
|
||||
expect(records[0].bondId).toBe(bondId1);
|
||||
records = await registry.queryRecords(queryv2, true);
|
||||
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true);
|
||||
expect(records[0].bondId).toBe(bondId1);
|
||||
|
||||
// Create another bond.
|
||||
@@ -147,16 +131,16 @@ const bondTests = () => {
|
||||
|
||||
// Reassociate records from bondId1 to bondId2, verify change.
|
||||
await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, fee);
|
||||
records = await registry.queryRecords(queryv1, true);
|
||||
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true);
|
||||
expect(records[0].bondId).toBe(bondId2);
|
||||
records = await registry.queryRecords(queryv2, true);
|
||||
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true);
|
||||
expect(records[0].bondId).toBe(bondId2);
|
||||
|
||||
// Dissociate all records from bond, verify change.
|
||||
await registry.dissociateRecords({ bondId: bondId2 }, privateKey, fee);
|
||||
records = await registry.queryRecords(queryv1, true);
|
||||
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true);
|
||||
expect(records[0].bondId).toBe('');
|
||||
records = await registry.queryRecords(queryv2, true);
|
||||
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true);
|
||||
expect(records[0].bondId).toBe('');
|
||||
});
|
||||
};
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ const registryTests = () => {
|
||||
let registry: Registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(restEndpoint, gqlEndpoint, chainId);
|
||||
|
||||
});
|
||||
|
||||
@@ -32,14 +32,14 @@ const registryTests = () => {
|
||||
test('Get account balance.', async() => {
|
||||
const mnenonic1 = Account.generateMnemonic();
|
||||
const otherAccount = await Account.generateFromMnemonic(mnenonic1);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '100000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '10000000000000000000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
|
||||
|
||||
const [accountObj] = await registry.getAccounts([otherAccount.formattedCosmosAddress]);
|
||||
expect(accountObj).toBeDefined();
|
||||
expect(accountObj.address).toBe(otherAccount.formattedCosmosAddress);
|
||||
const [{ type, quantity }] = accountObj.balance
|
||||
expect(type).toBe('aphoton');
|
||||
expect(quantity).toBe('100000000');
|
||||
expect(quantity).toBe('10000000000000000000000000');
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+14
-8
@@ -1,3 +1,4 @@
|
||||
import isUrl from 'is-url';
|
||||
import { sha256 } from 'js-sha256';
|
||||
import { generatePostBodyBroadcast, BroadcastMode } from '@tharsis/provider';
|
||||
import {
|
||||
@@ -44,7 +45,7 @@ import {
|
||||
MessageMsgSetRecord,
|
||||
NAMESERVICE_ERRORS,
|
||||
parseMsgSetRecordResponse
|
||||
} from './messages/registry';
|
||||
} from './messages/nameservice';
|
||||
import {
|
||||
createTxMsgCommitBid,
|
||||
createTxMsgRevealBid,
|
||||
@@ -52,8 +53,6 @@ import {
|
||||
MessageMsgRevealBid
|
||||
} from './messages/auction';
|
||||
|
||||
export const DEFAULT_CHAIN_ID = 'laconic_9000-1';
|
||||
|
||||
const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd.';
|
||||
|
||||
// Parse Tx response from cosmos-sdk.
|
||||
@@ -120,14 +119,21 @@ export class Registry {
|
||||
return errorMessage || DEFAULT_WRITE_ERROR;
|
||||
}
|
||||
|
||||
constructor(gqlUrl: string, restUrl: string = "", chainId: string = DEFAULT_CHAIN_ID) {
|
||||
constructor(restUrl: string, gqlUrl: string, chainId: string) {
|
||||
if (!isUrl(restUrl)) {
|
||||
throw new Error('Path to a REST endpoint should be provided.');
|
||||
}
|
||||
|
||||
if (!isUrl(gqlUrl)) {
|
||||
throw new Error('Path to a GQL endpoint should be provided.');
|
||||
}
|
||||
|
||||
this._endpoints = {
|
||||
rest: restUrl,
|
||||
gql: gqlUrl
|
||||
};
|
||||
|
||||
this._client = new RegistryClient(gqlUrl, restUrl);
|
||||
this._client = new RegistryClient(restUrl, gqlUrl);
|
||||
this._chainID = chainId;
|
||||
|
||||
this._chain = {
|
||||
@@ -180,9 +186,9 @@ export class Registry {
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish record.
|
||||
* @param transactionPrivateKey - private key in HEX to sign transaction.
|
||||
*/
|
||||
* Publish record.
|
||||
* @param transactionPrivateKey - private key in HEX to sign transaction.
|
||||
*/
|
||||
async setRecord(
|
||||
params: { privateKey: string, record: any, bondId: string },
|
||||
transactionPrivateKey: string,
|
||||
|
||||
+13
-13
@@ -8,7 +8,7 @@ import {
|
||||
} from '@tharsis/transactions'
|
||||
|
||||
import * as bondTx from '../proto/vulcanize/bond/v1beta1/tx'
|
||||
import * as registryTx from '../proto/vulcanize/registry/v1beta1/tx'
|
||||
import * as nameserviceTx from '../proto/vulcanize/nameservice/v1beta1/tx'
|
||||
import * as coin from '../proto/cosmos/base/v1beta1/coin'
|
||||
import { createTx } from './util'
|
||||
|
||||
@@ -475,7 +475,7 @@ function createMsgAssociateBond(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/AssociateBond',
|
||||
type: 'nameservice/AssociateBond',
|
||||
value: {
|
||||
record_id: recordId,
|
||||
bond_id: bondId,
|
||||
@@ -489,7 +489,7 @@ const protoCreateMsgAssociateBond = (
|
||||
bondId: string,
|
||||
signer: string
|
||||
) => {
|
||||
const associateBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgAssociateBond({
|
||||
const associateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgAssociateBond({
|
||||
record_id: recordId,
|
||||
bond_id: bondId,
|
||||
signer
|
||||
@@ -497,7 +497,7 @@ const protoCreateMsgAssociateBond = (
|
||||
|
||||
return {
|
||||
message: associateBondMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgAssociateBond',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgAssociateBond',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ function createMsgDissociateBond(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/DissociateBond',
|
||||
type: 'nameservice/DissociateBond',
|
||||
value: {
|
||||
record_id: recordId,
|
||||
signer
|
||||
@@ -518,14 +518,14 @@ const protoCreateMsgDissociateBond = (
|
||||
recordId: string,
|
||||
signer: string
|
||||
) => {
|
||||
const dissociateBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgDissociateBond({
|
||||
const dissociateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateBond({
|
||||
record_id: recordId,
|
||||
signer
|
||||
})
|
||||
|
||||
return {
|
||||
message: dissociateBondMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgDissociateBond',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgDissociateBond',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ function createMsgDissociateRecords(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/DissociateRecords',
|
||||
type: 'nameservice/DissociateRecords',
|
||||
value: {
|
||||
bond_id: bondId,
|
||||
signer
|
||||
@@ -546,14 +546,14 @@ const protoCreateMsgDissociateRecords = (
|
||||
bondId: string,
|
||||
signer: string
|
||||
) => {
|
||||
const dissociateRecordsMessage = new registryTx.vulcanize.registry.v1beta1.MsgDissociateRecords({
|
||||
const dissociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateRecords({
|
||||
bond_id: bondId,
|
||||
signer
|
||||
})
|
||||
|
||||
return {
|
||||
message: dissociateRecordsMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgDissociateRecords',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgDissociateRecords',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ function createMsgReAssociateRecords(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/ReassociateRecords',
|
||||
type: 'nameservice/ReassociateRecords',
|
||||
value: {
|
||||
new_bond_id: newBondId,
|
||||
old_bond_id: oldBondId,
|
||||
@@ -577,7 +577,7 @@ const protoCreateMsgReAssociateRecords = (
|
||||
oldBondId: string,
|
||||
signer: string
|
||||
) => {
|
||||
const reAssociateRecordsMessage = new registryTx.vulcanize.registry.v1beta1.MsgReAssociateRecords({
|
||||
const reAssociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReAssociateRecords({
|
||||
new_bond_id: newBondId,
|
||||
old_bond_id: oldBondId,
|
||||
signer
|
||||
@@ -585,6 +585,6 @@ const protoCreateMsgReAssociateRecords = (
|
||||
|
||||
return {
|
||||
message: reAssociateRecordsMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgReAssociateRecords',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgReAssociateRecords',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
Fee,
|
||||
} from '@tharsis/transactions'
|
||||
|
||||
import * as registryTx from '../proto/vulcanize/registry/v1beta1/tx'
|
||||
import * as registry from '../proto/vulcanize/registry/v1beta1/registry'
|
||||
import * as nameserviceTx from '../proto/vulcanize/nameservice/v1beta1/tx'
|
||||
import * as nameservice from '../proto/vulcanize/nameservice/v1beta1/nameservice'
|
||||
import { createTx } from './util'
|
||||
import { Payload } from '../types'
|
||||
|
||||
@@ -44,11 +44,7 @@ const MSG_SET_RECORD_TYPES = {
|
||||
{ name: 'create_time', type: 'string' },
|
||||
{ name: 'expiry_time', type: 'string' },
|
||||
{ name: 'deleted', type: 'bool' },
|
||||
{ name: 'attributes', type: 'TypePayloadRecordAttributes' },
|
||||
],
|
||||
TypePayloadRecordAttributes: [
|
||||
{ name: 'type_url', type: 'string' },
|
||||
{ name: 'value', type: 'uint8[]' },
|
||||
{ name: 'attributes', type: 'string' },
|
||||
],
|
||||
TypePayloadSignatures: [
|
||||
{ name: 'sig', type: 'string' },
|
||||
@@ -239,7 +235,7 @@ function createMsgReserveAuthority(
|
||||
owner: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/ReserveAuthority',
|
||||
type: 'nameservice/ReserveAuthority',
|
||||
value: {
|
||||
name,
|
||||
signer,
|
||||
@@ -253,7 +249,7 @@ const protoCreateMsgReserveAuthority = (
|
||||
signer: string,
|
||||
owner: string,
|
||||
) => {
|
||||
const reserveAuthorityMessage = new registryTx.vulcanize.registry.v1beta1.MsgReserveAuthority({
|
||||
const reserveAuthorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReserveAuthority({
|
||||
name,
|
||||
signer,
|
||||
owner
|
||||
@@ -261,7 +257,7 @@ const protoCreateMsgReserveAuthority = (
|
||||
|
||||
return {
|
||||
message: reserveAuthorityMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgReserveAuthority',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgReserveAuthority',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +267,7 @@ function createMsgSetName(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/SetName',
|
||||
type: 'nameservice/SetName',
|
||||
value: {
|
||||
crn,
|
||||
cid,
|
||||
@@ -285,7 +281,7 @@ const protoCreateMsgSetName = (
|
||||
cid: string,
|
||||
signer: string
|
||||
) => {
|
||||
const setNameMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetName({
|
||||
const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetName({
|
||||
crn,
|
||||
cid,
|
||||
signer,
|
||||
@@ -293,7 +289,7 @@ const protoCreateMsgSetName = (
|
||||
|
||||
return {
|
||||
message: setNameMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgSetName',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgSetName',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +299,7 @@ function createMsgSetRecord(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/SetRecord',
|
||||
type: 'nameservice/SetRecord',
|
||||
value: {
|
||||
bond_id: bondId,
|
||||
signer,
|
||||
@@ -317,20 +313,20 @@ const protoCreateMsgSetRecord = (
|
||||
payloadData: Payload,
|
||||
signer: string
|
||||
) => {
|
||||
const record = new registry.vulcanize.registry.v1beta1.Record(payloadData.record.serialize())
|
||||
const record = new nameservice.vulcanize.nameservice.v1beta1.Record(payloadData.record.serialize())
|
||||
|
||||
const signatures = payloadData.signatures.map(
|
||||
signature => new registry.vulcanize.registry.v1beta1.Signature(
|
||||
signature => new nameservice.vulcanize.nameservice.v1beta1.Signature(
|
||||
signature.serialize()
|
||||
)
|
||||
)
|
||||
|
||||
const payload = new registryTx.vulcanize.registry.v1beta1.Payload({
|
||||
const payload = new nameserviceTx.vulcanize.nameservice.v1beta1.Payload({
|
||||
record,
|
||||
signatures
|
||||
})
|
||||
|
||||
const setNameMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetRecord({
|
||||
const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetRecord({
|
||||
bond_id: bondId,
|
||||
signer,
|
||||
payload
|
||||
@@ -338,7 +334,7 @@ const protoCreateMsgSetRecord = (
|
||||
|
||||
return {
|
||||
message: setNameMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgSetRecord',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgSetRecord',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +344,7 @@ function createMsgSetAuthorityBond(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/SetAuthorityBond',
|
||||
type: 'nameservice/SetAuthorityBond',
|
||||
value: {
|
||||
name,
|
||||
bond_id: bondId,
|
||||
@@ -362,7 +358,7 @@ const protoCreateMsgSetAuthorityBond = (
|
||||
bondId: string,
|
||||
signer: string
|
||||
) => {
|
||||
const setAuthorityBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetAuthorityBond({
|
||||
const setAuthorityBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetAuthorityBond({
|
||||
name,
|
||||
bond_id: bondId,
|
||||
signer,
|
||||
@@ -370,7 +366,7 @@ const protoCreateMsgSetAuthorityBond = (
|
||||
|
||||
return {
|
||||
message: setAuthorityBondMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgSetAuthorityBond',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgSetAuthorityBond',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,7 +375,7 @@ function createMsgDeleteName(
|
||||
signer: string
|
||||
) {
|
||||
return {
|
||||
type: 'registry/DeleteAuthority',
|
||||
type: 'nameservice/DeleteAuthority',
|
||||
value: {
|
||||
crn,
|
||||
signer
|
||||
@@ -391,13 +387,13 @@ const protoCreateMsgDeleteName = (
|
||||
crn: string,
|
||||
signer: string
|
||||
) => {
|
||||
const deleteNameAutorityMessage = new registryTx.vulcanize.registry.v1beta1.MsgDeleteNameAuthority({
|
||||
const deleteNameAutorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority({
|
||||
crn,
|
||||
signer,
|
||||
})
|
||||
|
||||
return {
|
||||
message: deleteNameAutorityMessage,
|
||||
path: 'vulcanize.registry.v1beta1.MsgDeleteNameAuthority',
|
||||
path: 'vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority',
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ const nameserviceExpiryTests = () => {
|
||||
let recordExpiryTime: Date;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(restEndpoint, gqlEndpoint, chainId);
|
||||
|
||||
// Create bond.
|
||||
bondId = await registry.getNextBondId(privateKey);
|
||||
@@ -30,7 +30,7 @@ const nameserviceExpiryTests = () => {
|
||||
test('Set record and check bond balance', async () => {
|
||||
// Create watcher.
|
||||
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||
const result = await registry.setRecord(
|
||||
await registry.setRecord(
|
||||
{
|
||||
privateKey,
|
||||
bondId,
|
||||
@@ -39,8 +39,8 @@ const nameserviceExpiryTests = () => {
|
||||
privateKey,
|
||||
fee
|
||||
)
|
||||
console.log("SetRecordResult: " + result.data.id)
|
||||
const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
||||
|
||||
const [record] = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true);
|
||||
recordExpiryTime = new Date(record.expiryTime);
|
||||
|
||||
const [bond] = await registry.getBondsByIds([bondId]);
|
||||
@@ -63,22 +63,21 @@ const nameserviceExpiryTests = () => {
|
||||
});
|
||||
|
||||
test('Check record expiry time', async() => {
|
||||
const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
||||
const updatedExpiryTime = new Date();
|
||||
const [record] = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true);
|
||||
const updatedExpiryTime = new Date(record.expiryTime);
|
||||
expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime());
|
||||
recordExpiryTime = updatedExpiryTime;
|
||||
})
|
||||
|
||||
test('Check authority expiry time', async() => {
|
||||
const [authority] = await registry.lookupAuthorities([authorityName]);
|
||||
const updatedExpiryTime = new Date();
|
||||
const updatedExpiryTime = new Date(authority.expiryTime);
|
||||
expect(updatedExpiryTime.getTime()).toBeGreaterThan(authorityExpiryTime.getTime());
|
||||
authorityExpiryTime = updatedExpiryTime;
|
||||
})
|
||||
|
||||
test('Check bond balance', async () => {
|
||||
const [bond] = await registry.getBondsByIds([bondId]);
|
||||
console.log(bond)
|
||||
expect(bond).toBeDefined();
|
||||
expect(bond.balance).toHaveLength(0);
|
||||
})
|
||||
@@ -88,7 +87,7 @@ const nameserviceExpiryTests = () => {
|
||||
});
|
||||
|
||||
test('Check record deleted without bond balance', async() => {
|
||||
const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
||||
const records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true);
|
||||
expect(records).toHaveLength(0);
|
||||
})
|
||||
|
||||
@@ -105,7 +104,7 @@ if (!process.env.TEST_NAMESERVICE_EXPIRY) {
|
||||
/**
|
||||
Running these tests requires timers to be set. In laconicd repo run:
|
||||
|
||||
TEST_REGISTRY_EXPIRY=true ./init.sh
|
||||
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
||||
|
||||
|
||||
Run tests:
|
||||
|
||||
+186
-229
@@ -18,12 +18,18 @@ const namingTests = () => {
|
||||
let watcher: any;
|
||||
let watcherId: string;
|
||||
|
||||
let authorityName: string;
|
||||
let otherAuthorityName: string;
|
||||
let otherPrivateKey: string;
|
||||
|
||||
let crn: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(restEndpoint, gqlEndpoint, chainId);
|
||||
|
||||
// Create bond.
|
||||
bondId = await registry.getNextBondId(privateKey);
|
||||
await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee);
|
||||
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
|
||||
|
||||
// Create watcher.
|
||||
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||
@@ -40,271 +46,222 @@ const namingTests = () => {
|
||||
watcherId = result.data.id;
|
||||
});
|
||||
|
||||
describe('Authority tests', () => {
|
||||
test('Reserve authority.', async () => {
|
||||
const authorityName = `laconic-${Date.now()}`;
|
||||
|
||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||
});
|
||||
|
||||
describe('With authority reserved', () => {
|
||||
let authorityName: string;
|
||||
let crn: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
authorityName = `laconic-${Date.now()}`;
|
||||
crn = `crn://${authorityName}/app/test`;
|
||||
|
||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||
})
|
||||
|
||||
test('Lookup authority.', async () => {
|
||||
const [record] = await registry.lookupAuthorities([authorityName]);
|
||||
|
||||
expect(record).toBeDefined();
|
||||
expect(record.ownerAddress).not.toBe('');
|
||||
expect(record.ownerPublicKey).not.toBe('');
|
||||
expect(Number(record.height)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('Lookup non existing authority', async () => {
|
||||
const [record] = await registry.lookupAuthorities(['does-not-exist']);
|
||||
|
||||
expect(record.ownerAddress).toBe('');
|
||||
expect(record.ownerPublicKey).toBe('');
|
||||
expect(Number(record.height)).toBe(0);
|
||||
});
|
||||
|
||||
test('Reserve already reserved authority', async () => {
|
||||
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).
|
||||
rejects.toThrow('Name already reserved.');
|
||||
});
|
||||
|
||||
test('Reserve sub-authority.', async () => {
|
||||
const subAuthority = `echo.${authorityName}`;
|
||||
await registry.reserveAuthority({ name: subAuthority }, privateKey, fee);
|
||||
|
||||
const [record] = await registry.lookupAuthorities([subAuthority]);
|
||||
expect(record).toBeDefined();
|
||||
expect(record.ownerAddress).not.toBe('');
|
||||
expect(record.ownerPublicKey).not.toBe('');
|
||||
expect(Number(record.height)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('Reserve sub-authority with different owner.', async () => {
|
||||
// Create another account, send tx to set public key on the account.
|
||||
const mnenonic1 = Account.generateMnemonic();
|
||||
const otherAccount1 = await Account.generateFromMnemonic(mnenonic1);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount1.formattedCosmosAddress }, privateKey, fee);
|
||||
|
||||
const mnenonic2 = Account.generateMnemonic();
|
||||
const otherAccount2 = await Account.generateFromMnemonic(mnenonic2);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '10', destinationAddress: otherAccount2.formattedCosmosAddress }, otherAccount1.getPrivateKey(), fee);
|
||||
|
||||
const subAuthority = `halo.${authorityName}`;
|
||||
await registry.reserveAuthority({ name: subAuthority, owner: otherAccount1.formattedCosmosAddress }, privateKey, fee);
|
||||
|
||||
const [record] = await registry.lookupAuthorities([subAuthority]);
|
||||
expect(record).toBeDefined();
|
||||
expect(record.ownerAddress).toBeDefined();
|
||||
expect(record.ownerAddress).toBe(otherAccount1.getCosmosAddress());
|
||||
expect(record.ownerPublicKey).toBeDefined();
|
||||
expect(Number(record.height)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('Set name for unbonded authority', async () => {
|
||||
assert(watcherId)
|
||||
await expect(registry.setName({ crn, cid: watcherId }, privateKey, fee)).
|
||||
rejects.toThrow('Authority bond not found.');
|
||||
});
|
||||
|
||||
test('Set authority bond', async () => {
|
||||
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
|
||||
});
|
||||
});
|
||||
test('Reserve authority.', async () => {
|
||||
authorityName = `laconic-${Date.now()}`;
|
||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||
});
|
||||
|
||||
describe('Naming tests', () => {
|
||||
let authorityName: string;
|
||||
let otherAuthorityName: string;
|
||||
let otherPrivateKey: string;
|
||||
let otherAccount: Account;
|
||||
test('Lookup authority.', async () => {
|
||||
const [record] = await registry.lookupAuthorities([authorityName]);
|
||||
|
||||
beforeAll(async () => {
|
||||
authorityName = `laconic-${Date.now()}`;
|
||||
expect(record).toBeDefined();
|
||||
expect(record.ownerAddress).not.toBe('');
|
||||
expect(record.ownerPublicKey).not.toBe('');
|
||||
expect(Number(record.height)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
|
||||
test('Lookup non existing authority', async () => {
|
||||
const [record] = await registry.lookupAuthorities(['does-not-exist']);
|
||||
|
||||
// Create another account.
|
||||
const mnenonic = Account.generateMnemonic();
|
||||
otherAccount = await Account.generateFromMnemonic(mnenonic);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
|
||||
expect(record.ownerAddress).toBe('');
|
||||
expect(record.ownerPublicKey).toBe('');
|
||||
expect(Number(record.height)).toBe(0);
|
||||
});
|
||||
|
||||
otherAuthorityName = `other-${Date.now()}`;
|
||||
otherPrivateKey = otherAccount.privateKey.toString('hex');
|
||||
});
|
||||
test('Reserve already reserved authority', async () => {
|
||||
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).rejects.toThrow('Name already reserved.');
|
||||
});
|
||||
|
||||
test('Set name', async () => {
|
||||
const crn = `crn://${authorityName}/app/test1`;
|
||||
test('Reserve sub-authority.', async () => {
|
||||
const subAuthority = `echo.${authorityName}`;
|
||||
await registry.reserveAuthority({ name: subAuthority }, privateKey, fee);
|
||||
|
||||
await registry.setName({ crn, cid: watcherId }, privateKey, fee);
|
||||
const [record] = await registry.lookupAuthorities([subAuthority]);
|
||||
expect(record).toBeDefined();
|
||||
expect(record.ownerAddress).not.toBe('');
|
||||
expect(record.ownerPublicKey).not.toBe('');
|
||||
expect(Number(record.height)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
// Query records should return it (some CRN points to it).
|
||||
const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version });
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
test('Reserve sub-authority with different owner.', async () => {
|
||||
// Create another account, send tx to set public key on the account.
|
||||
const mnenonic1 = Account.generateMnemonic();
|
||||
const otherAccount1 = await Account.generateFromMnemonic(mnenonic1);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount1.formattedCosmosAddress }, privateKey, fee);
|
||||
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
});
|
||||
const mnenonic2 = Account.generateMnemonic();
|
||||
const otherAccount2 = await Account.generateFromMnemonic(mnenonic2);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '10', destinationAddress: otherAccount2.formattedCosmosAddress }, otherAccount1.getPrivateKey(), fee);
|
||||
|
||||
describe('With name set', () => {
|
||||
let crn: string;
|
||||
const subAuthority = `halo.${authorityName}`;
|
||||
await registry.reserveAuthority({ name: subAuthority, owner: otherAccount1.formattedCosmosAddress }, privateKey, fee);
|
||||
|
||||
beforeAll(async () => {
|
||||
crn = `crn://${authorityName}/app/test2`;
|
||||
await registry.setName({ crn, cid: watcherId }, privateKey, fee);
|
||||
});
|
||||
const [record] = await registry.lookupAuthorities([subAuthority]);
|
||||
expect(record).toBeDefined();
|
||||
expect(record.ownerAddress).toBeDefined();
|
||||
expect(record.ownerAddress).toBe(otherAccount1.getCosmosAddress());
|
||||
expect(record.ownerPublicKey).toBeDefined();
|
||||
expect(Number(record.height)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
});
|
||||
test('Set name for unbonded authority', async () => {
|
||||
crn = `crn://${authorityName}/app/test`;
|
||||
assert(watcherId)
|
||||
await expect(registry.setName({ crn, cid: watcherId }, privateKey, fee)).rejects.toThrow('Authority bond not found.');
|
||||
});
|
||||
|
||||
test('Lookup name', async () => {
|
||||
const records = await registry.lookupNames([crn]);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
test('Set authority bond', async () => {
|
||||
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
|
||||
});
|
||||
|
||||
const [{ latest, history }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe(watcherId);
|
||||
expect(latest.height).toBeDefined();
|
||||
expect(history).toBeUndefined();
|
||||
});
|
||||
test('Set name', async () => {
|
||||
crn = `crn://${authorityName}/app/test`;
|
||||
await registry.setName({ crn, cid: watcherId }, privateKey, fee);
|
||||
|
||||
test('Resolve name', async () => {
|
||||
const records = await registry.resolveNames([crn]);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
// Query records should return it (some CRN points to it).
|
||||
const records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version });
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
});
|
||||
|
||||
const [{ attributes }] = records;
|
||||
expect(attributes).toEqual(watcher.record);
|
||||
});
|
||||
test('Lookup name', async () => {
|
||||
const records = await registry.lookupNames([crn]);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
|
||||
test('Lookup name with history', async () => {
|
||||
const updatedWatcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||
const result = await registry.setRecord(
|
||||
{
|
||||
privateKey,
|
||||
bondId,
|
||||
record: updatedWatcher.record
|
||||
},
|
||||
privateKey,
|
||||
fee
|
||||
)
|
||||
const [{ latest, history }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe(watcherId);
|
||||
expect(latest.height).toBeDefined();
|
||||
expect(history).toBeUndefined();
|
||||
});
|
||||
|
||||
const updatedWatcherId = result.data.id;
|
||||
await registry.setName({ crn, cid: updatedWatcherId }, privateKey, fee);
|
||||
test('Resolve name', async () => {
|
||||
const records = await registry.resolveNames([crn]);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
|
||||
const records = await registry.lookupNames([crn], true);
|
||||
expect(records).toHaveLength(1);
|
||||
const [{ attributes }] = records;
|
||||
expect(attributes).toEqual(watcher.record);
|
||||
});
|
||||
|
||||
const [{ latest, history }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe(updatedWatcherId);
|
||||
expect(latest.height).toBeDefined();
|
||||
expect(history).toBeDefined();
|
||||
expect(history).toHaveLength(1);
|
||||
test('Lookup name with history', async () => {
|
||||
const updatedWatcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||
const result = await registry.setRecord(
|
||||
{
|
||||
privateKey,
|
||||
bondId,
|
||||
record: updatedWatcher.record
|
||||
},
|
||||
privateKey,
|
||||
fee
|
||||
)
|
||||
|
||||
const [oldRecord] = history;
|
||||
expect(oldRecord).toBeDefined();
|
||||
expect(oldRecord.id).toBeDefined();
|
||||
expect(oldRecord.id).toBe(watcherId);
|
||||
expect(oldRecord.height).toBeDefined();
|
||||
});
|
||||
const updatedWatcherId = result.data.id;
|
||||
await registry.setName({ crn, cid: updatedWatcherId }, privateKey, fee);
|
||||
|
||||
test('Delete name', async () => {
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
const records = await registry.lookupNames([crn], true);
|
||||
expect(records).toHaveLength(1);
|
||||
|
||||
let records = await registry.lookupNames([crn], true);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
const [{ latest, history }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe(updatedWatcherId);
|
||||
expect(latest.height).toBeDefined();
|
||||
expect(history).toBeDefined();
|
||||
expect(history).toHaveLength(1);
|
||||
|
||||
const [{ latest }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe('');
|
||||
expect(latest.height).toBeDefined();
|
||||
const [oldRecord] = history;
|
||||
expect(oldRecord).toBeDefined();
|
||||
expect(oldRecord.id).toBeDefined();
|
||||
expect(oldRecord.id).toBe(watcherId);
|
||||
expect(oldRecord.height).toBeDefined();
|
||||
});
|
||||
|
||||
// Query records should NOT return it (no CRN points to it).
|
||||
records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version });
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(0);
|
||||
test('Set name without reserving authority', async () => {
|
||||
await expect(registry.setName({ crn: 'crn://not-reserved/app/test', cid: watcherId }, privateKey, fee))
|
||||
.rejects.toThrow('Name authority not found.');
|
||||
});
|
||||
|
||||
// Query all records should return it (all: true).
|
||||
records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
});
|
||||
test('Set name for non-owned authority', async () => {
|
||||
// Create another account.
|
||||
const mnenonic = Account.generateMnemonic();
|
||||
const otherAccount = await Account.generateFromMnemonic(mnenonic);
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
|
||||
|
||||
test('Delete already deleted name', async () => {
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
// Other account reserves an authority.
|
||||
otherAuthorityName = `other-${Date.now()}`;
|
||||
otherPrivateKey = otherAccount.privateKey.toString('hex');
|
||||
await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee);
|
||||
|
||||
const records = await registry.lookupNames([crn], true);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
// Try setting name under other authority.
|
||||
await expect(registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.');
|
||||
});
|
||||
|
||||
const [{ latest }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe('');
|
||||
expect(latest.height).toBeDefined();
|
||||
});
|
||||
});
|
||||
test('Lookup non existing name', async () => {
|
||||
const records = await registry.lookupNames(['crn://not-reserved/app/test']);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
const [record] = records;
|
||||
expect(record).toBeNull();
|
||||
});
|
||||
|
||||
test('Set name without reserving authority', async () => {
|
||||
await expect(registry.setName({ crn: 'crn://not-reserved/app/test', cid: watcherId }, privateKey, fee))
|
||||
.rejects.toThrow('Name authority not found.');
|
||||
});
|
||||
test('Resolve non existing name', async () => {
|
||||
const records = await registry.resolveNames(['crn://not-reserved/app/test']);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
const [record] = records;
|
||||
expect(record).toBeNull();
|
||||
});
|
||||
|
||||
test('Set name for non-owned authority', async () => {
|
||||
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
|
||||
test('Delete name', async () => {
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
|
||||
// Other account reserves an authority.
|
||||
await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee);
|
||||
let records = await registry.lookupNames([crn], true);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
|
||||
// Try setting name under other authority.
|
||||
await expect(registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.');
|
||||
});
|
||||
const [{ latest }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe('');
|
||||
expect(latest.height).toBeDefined();
|
||||
|
||||
test('Delete name for non-owned authority.', async () => {
|
||||
const otherBondId = await registry.getNextBondId(otherPrivateKey);
|
||||
await registry.createBond({ denom: 'aphoton', amount: '10000' }, otherPrivateKey, fee);
|
||||
await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee);
|
||||
await registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee);
|
||||
// Query records should NOT return it (no CRN points to it).
|
||||
records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version });
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(0);
|
||||
|
||||
// Try deleting name under other authority.
|
||||
await expect(registry.deleteName({ crn: `crn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.');
|
||||
});
|
||||
// Query all records should return it (all: true).
|
||||
records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
});
|
||||
|
||||
test('Lookup non existing name', async () => {
|
||||
const records = await registry.lookupNames(['crn://not-reserved/app/test']);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
const [record] = records;
|
||||
expect(record).toBeNull();
|
||||
});
|
||||
test('Delete already deleted name', async () => {
|
||||
await registry.deleteName({ crn }, privateKey, fee);
|
||||
|
||||
test('Resolve non existing name', async () => {
|
||||
const records = await registry.resolveNames(['crn://not-reserved/app/test']);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
const [record] = records;
|
||||
expect(record).toBeNull();
|
||||
});
|
||||
const records = await registry.lookupNames([crn], true);
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toBeDefined();
|
||||
expect(records).toHaveLength(1);
|
||||
|
||||
const [{ latest }] = records;
|
||||
expect(latest).toBeDefined();
|
||||
expect(latest.id).toBeDefined();
|
||||
expect(latest.id).toBe('');
|
||||
expect(latest.height).toBeDefined();
|
||||
});
|
||||
|
||||
test('Delete name for non-owned authority.', async () => {
|
||||
const otherBondId = await registry.getNextBondId(otherPrivateKey);
|
||||
await registry.createBond({ denom: 'aphoton', amount: '10000' }, otherPrivateKey, fee);
|
||||
await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee);
|
||||
await registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee);
|
||||
|
||||
// Try deleting name under other authority.
|
||||
await expect(registry.deleteName({ crn: `crn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.12.4
|
||||
* compiler version: 3.14.0
|
||||
* source: cosmos/base/query/v1beta1/pagination.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace cosmos.base.query.v1beta1 {
|
||||
export class PageRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
key?: Uint8Array;
|
||||
offset?: number;
|
||||
@@ -17,7 +16,7 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
reverse?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("key" in data && data.key != undefined) {
|
||||
this.key = data.key;
|
||||
@@ -37,31 +36,31 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
}
|
||||
}
|
||||
get key() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array()) as Uint8Array;
|
||||
return pb_1.Message.getField(this, 1) as Uint8Array;
|
||||
}
|
||||
set key(value: Uint8Array) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get offset() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
return pb_1.Message.getField(this, 2) as number;
|
||||
}
|
||||
set offset(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get limit() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
|
||||
return pb_1.Message.getField(this, 3) as number;
|
||||
}
|
||||
set limit(value: number) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get count_total() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
||||
return pb_1.Message.getField(this, 4) as boolean;
|
||||
}
|
||||
set count_total(value: boolean) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get reverse() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
|
||||
return pb_1.Message.getField(this, 5) as boolean;
|
||||
}
|
||||
set reverse(value: boolean) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
@@ -72,7 +71,7 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
limit?: number;
|
||||
count_total?: boolean;
|
||||
reverse?: boolean;
|
||||
}): PageRequest {
|
||||
}) {
|
||||
const message = new PageRequest({});
|
||||
if (data.key != null) {
|
||||
message.key = data.key;
|
||||
@@ -120,15 +119,15 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.key.length)
|
||||
if (this.key !== undefined)
|
||||
writer.writeBytes(1, this.key);
|
||||
if (this.offset != 0)
|
||||
if (this.offset !== undefined)
|
||||
writer.writeUint64(2, this.offset);
|
||||
if (this.limit != 0)
|
||||
if (this.limit !== undefined)
|
||||
writer.writeUint64(3, this.limit);
|
||||
if (this.count_total != false)
|
||||
if (this.count_total !== undefined)
|
||||
writer.writeBool(4, this.count_total);
|
||||
if (this.reverse != false)
|
||||
if (this.reverse !== undefined)
|
||||
writer.writeBool(5, this.reverse);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
@@ -167,13 +166,12 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
}
|
||||
}
|
||||
export class PageResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("next_key" in data && data.next_key != undefined) {
|
||||
this.next_key = data.next_key;
|
||||
@@ -184,13 +182,13 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
}
|
||||
}
|
||||
get next_key() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array()) as Uint8Array;
|
||||
return pb_1.Message.getField(this, 1) as Uint8Array;
|
||||
}
|
||||
set next_key(value: Uint8Array) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get total() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
return pb_1.Message.getField(this, 2) as number;
|
||||
}
|
||||
set total(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
@@ -198,7 +196,7 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
static fromObject(data: {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
}): PageResponse {
|
||||
}) {
|
||||
const message = new PageResponse({});
|
||||
if (data.next_key != null) {
|
||||
message.next_key = data.next_key;
|
||||
@@ -225,9 +223,9 @@ export namespace cosmos.base.query.v1beta1 {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.next_key.length)
|
||||
if (this.next_key !== undefined)
|
||||
writer.writeBytes(1, this.next_key);
|
||||
if (this.total != 0)
|
||||
if (this.total !== undefined)
|
||||
writer.writeUint64(2, this.total);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.12.4
|
||||
* compiler version: 3.14.0
|
||||
* source: cosmos/base/v1beta1/coin.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 cosmos.base.v1beta1 {
|
||||
export class Coin extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("denom" in data && data.denom != undefined) {
|
||||
this.denom = data.denom;
|
||||
@@ -26,13 +25,13 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
get denom() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
return pb_1.Message.getField(this, 1) as string;
|
||||
}
|
||||
set denom(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get amount() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
return pb_1.Message.getField(this, 2) as string;
|
||||
}
|
||||
set amount(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
@@ -40,7 +39,7 @@ export namespace cosmos.base.v1beta1 {
|
||||
static fromObject(data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}): Coin {
|
||||
}) {
|
||||
const message = new Coin({});
|
||||
if (data.denom != null) {
|
||||
message.denom = data.denom;
|
||||
@@ -67,9 +66,9 @@ export namespace cosmos.base.v1beta1 {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.denom.length)
|
||||
if (typeof this.denom === "string" && this.denom.length)
|
||||
writer.writeString(1, this.denom);
|
||||
if (this.amount.length)
|
||||
if (typeof this.amount === "string" && this.amount.length)
|
||||
writer.writeString(2, this.amount);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
@@ -99,13 +98,12 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
export class DecCoin extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("denom" in data && data.denom != undefined) {
|
||||
this.denom = data.denom;
|
||||
@@ -116,13 +114,13 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
get denom() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
return pb_1.Message.getField(this, 1) as string;
|
||||
}
|
||||
set denom(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get amount() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
return pb_1.Message.getField(this, 2) as string;
|
||||
}
|
||||
set amount(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
@@ -130,7 +128,7 @@ export namespace cosmos.base.v1beta1 {
|
||||
static fromObject(data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}): DecCoin {
|
||||
}) {
|
||||
const message = new DecCoin({});
|
||||
if (data.denom != null) {
|
||||
message.denom = data.denom;
|
||||
@@ -157,9 +155,9 @@ export namespace cosmos.base.v1beta1 {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.denom.length)
|
||||
if (typeof this.denom === "string" && this.denom.length)
|
||||
writer.writeString(1, this.denom);
|
||||
if (this.amount.length)
|
||||
if (typeof this.amount === "string" && this.amount.length)
|
||||
writer.writeString(2, this.amount);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
@@ -189,12 +187,11 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
export class IntProto extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
int?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("int" in data && data.int != undefined) {
|
||||
this.int = data.int;
|
||||
@@ -202,14 +199,14 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
get int() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
return pb_1.Message.getField(this, 1) as string;
|
||||
}
|
||||
set int(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
int?: string;
|
||||
}): IntProto {
|
||||
}) {
|
||||
const message = new IntProto({});
|
||||
if (data.int != null) {
|
||||
message.int = data.int;
|
||||
@@ -229,7 +226,7 @@ export namespace cosmos.base.v1beta1 {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.int.length)
|
||||
if (typeof this.int === "string" && this.int.length)
|
||||
writer.writeString(1, this.int);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
@@ -256,12 +253,11 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
export class DecProto extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
dec?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("dec" in data && data.dec != undefined) {
|
||||
this.dec = data.dec;
|
||||
@@ -269,14 +265,14 @@ export namespace cosmos.base.v1beta1 {
|
||||
}
|
||||
}
|
||||
get dec() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
return pb_1.Message.getField(this, 1) as string;
|
||||
}
|
||||
set dec(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
dec?: string;
|
||||
}): DecProto {
|
||||
}) {
|
||||
const message = new DecProto({});
|
||||
if (data.dec != null) {
|
||||
message.dec = data.dec;
|
||||
@@ -296,7 +292,7 @@ export namespace cosmos.base.v1beta1 {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.dec.length)
|
||||
if (typeof this.dec === "string" && this.dec.length)
|
||||
writer.writeString(1, this.dec);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.12.4
|
||||
* compiler version: 3.14.0
|
||||
* source: gogoproto/gogo.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../google/protobuf/descriptor";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.12.4
|
||||
* compiler version: 3.14.0
|
||||
* source: google/api/annotations.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./http";
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.12.4
|
||||
* compiler version: 3.14.0
|
||||
* source: google/api/http.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace google.api {
|
||||
export class Http extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
rules?: HttpRule[];
|
||||
fully_decode_reserved_expansion?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("rules" in data && data.rules != undefined) {
|
||||
this.rules = data.rules;
|
||||
@@ -31,7 +30,7 @@ export namespace google.api {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
get fully_decode_reserved_expansion() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
|
||||
return pb_1.Message.getField(this, 2) as boolean;
|
||||
}
|
||||
set fully_decode_reserved_expansion(value: boolean) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
@@ -39,7 +38,7 @@ export namespace google.api {
|
||||
static fromObject(data: {
|
||||
rules?: ReturnType<typeof HttpRule.prototype.toObject>[];
|
||||
fully_decode_reserved_expansion?: boolean;
|
||||
}): Http {
|
||||
}) {
|
||||
const message = new Http({});
|
||||
if (data.rules != null) {
|
||||
message.rules = data.rules.map(item => HttpRule.fromObject(item));
|
||||
@@ -66,9 +65,9 @@ export namespace google.api {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.rules.length)
|
||||
if (this.rules !== undefined)
|
||||
writer.writeRepeatedMessage(1, this.rules, (item: HttpRule) => item.serialize(writer));
|
||||
if (this.fully_decode_reserved_expansion != false)
|
||||
if (this.fully_decode_reserved_expansion !== undefined)
|
||||
writer.writeBool(2, this.fully_decode_reserved_expansion);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
@@ -98,7 +97,6 @@ export namespace google.api {
|
||||
}
|
||||
}
|
||||
export class HttpRule extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [[2, 3, 4, 5, 6, 8]];
|
||||
constructor(data?: any[] | ({
|
||||
selector?: string;
|
||||
body?: string;
|
||||
@@ -148,7 +146,7 @@ export namespace google.api {
|
||||
custom?: CustomHttpPattern;
|
||||
})))) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], [[2, 3, 4, 5, 6, 8]]);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("selector" in data && data.selector != undefined) {
|
||||
this.selector = data.selector;
|
||||
@@ -183,73 +181,55 @@ export namespace google.api {
|
||||
}
|
||||
}
|
||||
get selector() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
return pb_1.Message.getField(this, 1) as string;
|
||||
}
|
||||
set selector(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get get() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
return pb_1.Message.getField(this, 2) as string;
|
||||
}
|
||||
set get(value: string) {
|
||||
pb_1.Message.setOneofField(this, 2, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_get() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
pb_1.Message.setOneofField(this, 2, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get put() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||
return pb_1.Message.getField(this, 3) as string;
|
||||
}
|
||||
set put(value: string) {
|
||||
pb_1.Message.setOneofField(this, 3, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_put() {
|
||||
return pb_1.Message.getField(this, 3) != null;
|
||||
pb_1.Message.setOneofField(this, 3, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get post() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
||||
return pb_1.Message.getField(this, 4) as string;
|
||||
}
|
||||
set post(value: string) {
|
||||
pb_1.Message.setOneofField(this, 4, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_post() {
|
||||
return pb_1.Message.getField(this, 4) != null;
|
||||
pb_1.Message.setOneofField(this, 4, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get delete() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
|
||||
return pb_1.Message.getField(this, 5) as string;
|
||||
}
|
||||
set delete(value: string) {
|
||||
pb_1.Message.setOneofField(this, 5, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_delete() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
pb_1.Message.setOneofField(this, 5, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get patch() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
||||
return pb_1.Message.getField(this, 6) as string;
|
||||
}
|
||||
set patch(value: string) {
|
||||
pb_1.Message.setOneofField(this, 6, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_patch() {
|
||||
return pb_1.Message.getField(this, 6) != null;
|
||||
pb_1.Message.setOneofField(this, 6, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get custom() {
|
||||
return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8) as CustomHttpPattern;
|
||||
}
|
||||
set custom(value: CustomHttpPattern) {
|
||||
pb_1.Message.setOneofWrapperField(this, 8, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_custom() {
|
||||
return pb_1.Message.getField(this, 8) != null;
|
||||
pb_1.Message.setOneofWrapperField(this, 8, [2, 3, 4, 5, 6, 8], value);
|
||||
}
|
||||
get body() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
|
||||
return pb_1.Message.getField(this, 7) as string;
|
||||
}
|
||||
set body(value: string) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
get response_body() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 12, "") as string;
|
||||
return pb_1.Message.getField(this, 12) as string;
|
||||
}
|
||||
set response_body(value: string) {
|
||||
pb_1.Message.setField(this, 12, value);
|
||||
@@ -285,7 +265,7 @@ export namespace google.api {
|
||||
body?: string;
|
||||
response_body?: string;
|
||||
additional_bindings?: ReturnType<typeof HttpRule.prototype.toObject>[];
|
||||
}): HttpRule {
|
||||
}) {
|
||||
const message = new HttpRule({});
|
||||
if (data.selector != null) {
|
||||
message.selector = data.selector;
|
||||
@@ -368,25 +348,25 @@ export namespace google.api {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.selector.length)
|
||||
if (typeof this.selector === "string" && this.selector.length)
|
||||
writer.writeString(1, this.selector);
|
||||
if (this.has_get)
|
||||
if (typeof this.get === "string" && this.get.length)
|
||||
writer.writeString(2, this.get);
|
||||
if (this.has_put)
|
||||
if (typeof this.put === "string" && this.put.length)
|
||||
writer.writeString(3, this.put);
|
||||
if (this.has_post)
|
||||
if (typeof this.post === "string" && this.post.length)
|
||||
writer.writeString(4, this.post);
|
||||
if (this.has_delete)
|
||||
if (typeof this.delete === "string" && this.delete.length)
|
||||
writer.writeString(5, this.delete);
|
||||
if (this.has_patch)
|
||||
if (typeof this.patch === "string" && this.patch.length)
|
||||
writer.writeString(6, this.patch);
|
||||
if (this.has_custom)
|
||||
if (this.custom !== undefined)
|
||||
writer.writeMessage(8, this.custom, () => this.custom.serialize(writer));
|
||||
if (this.body.length)
|
||||
if (typeof this.body === "string" && this.body.length)
|
||||
writer.writeString(7, this.body);
|
||||
if (this.response_body.length)
|
||||
if (typeof this.response_body === "string" && this.response_body.length)
|
||||
writer.writeString(12, this.response_body);
|
||||
if (this.additional_bindings.length)
|
||||
if (this.additional_bindings !== undefined)
|
||||
writer.writeRepeatedMessage(11, this.additional_bindings, (item: HttpRule) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
@@ -440,13 +420,12 @@ export namespace google.api {
|
||||
}
|
||||
}
|
||||
export class CustomHttpPattern extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
kind?: string;
|
||||
path?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("kind" in data && data.kind != undefined) {
|
||||
this.kind = data.kind;
|
||||
@@ -457,13 +436,13 @@ export namespace google.api {
|
||||
}
|
||||
}
|
||||
get kind() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
return pb_1.Message.getField(this, 1) as string;
|
||||
}
|
||||
set kind(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get path() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
return pb_1.Message.getField(this, 2) as string;
|
||||
}
|
||||
set path(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
@@ -471,7 +450,7 @@ export namespace google.api {
|
||||
static fromObject(data: {
|
||||
kind?: string;
|
||||
path?: string;
|
||||
}): CustomHttpPattern {
|
||||
}) {
|
||||
const message = new CustomHttpPattern({});
|
||||
if (data.kind != null) {
|
||||
message.kind = data.kind;
|
||||
@@ -498,9 +477,9 @@ export namespace google.api {
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.kind.length)
|
||||
if (typeof this.kind === "string" && this.kind.length)
|
||||
writer.writeString(1, this.kind);
|
||||
if (this.path.length)
|
||||
if (typeof this.path === "string" && this.path.length)
|
||||
writer.writeString(2, this.path);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 3.12.4
|
||||
* 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()) 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user