Compare commits

..
Author SHA1 Message Date
dboreham 9176bb1a5a Revert postinstall script 2022-09-28 20:19:21 -06:00
dboreham 10a4ecd5f2 Add built artifacts so yarn install works on this module from git 2022-09-28 20:18:00 -06:00
dboreham ff3d70cc0d Add postinstall target 2022-09-28 19:52:00 -06:00
dboreham b1d3c83d32 Files the IDE thoughtfully did not save earlier 2022-09-28 13:22:57 -06:00
dboreham b07df23804 Blind attempt to re-brand 2022-09-28 13:20:15 -06:00
nabarun 27a176fbad Implement methods and tests for associate/dissociate bonds and records (#4)
* Implement methods for bond associate and dissociate

* Uncomment test for getStatus GQL query
2022-04-27 15:30:21 +05:30
nabarun 3d103b5fca Add getRecordsByIds method and sdk tests (#3)
* Implement getRecordsByIds method

* Add tests for sdk
2022-04-25 15:12:46 +05:30
nabarun 003cfcbf5c Use GQL query getAccounts instead of REST API 2022-04-22 16:01:04 +05:30
nabarun 349bc650d9 Generate same CID from chiba-clonk chain 2022-04-22 16:01:04 +05:30
nabarun 28c8099b16 Get record id from setRecord message response 2022-04-21 09:44:24 +05:30
nabarun 79b55b73da Replace wrn with crn 2022-04-21 09:44:24 +05:30
nabarun e563cfe6b1 Add tests for record and authority expiry 2022-04-21 09:44:24 +05:30
nabarun 6ca9f4041a Fixes from review 2022-04-21 09:44:24 +05:30
nabarun c3066db987 Add test for util getContentId 2022-04-21 09:44:24 +05:30
nabarun 407d31cea7 Fix queryRecords to return results filtered by attributes 2022-04-21 09:44:24 +05:30
nabarun 0bc619cad2 Send messages from secondary accounts 2022-04-21 09:44:24 +05:30
nabarun 838edaa9a6 Add auction tests for commitBid and revealBid 2022-04-21 09:44:24 +05:30
nabarun d51f9618e0 Implement tests for auction module 2022-04-21 09:44:24 +05:30
nabarun 44b3990377 Fix generating account address from private key 2022-04-21 09:44:24 +05:30
nabarun 837d9691ec Check if error contains expected message for failing transactions 2022-04-21 09:44:24 +05:30
nabarun 394f015a5e Add tests for nameservice deleteName 2022-04-21 09:44:24 +05:30
nabarun f207be4838 Add tests for querying names and deleteName 2022-04-21 09:44:24 +05:30
nabarun 9de3c59c19 Implement setRecord and add test for setAutorityBond 2022-04-21 09:44:24 +05:30
nabarun 48507ca46a Rename ethermint to chibaclonk 2022-04-21 09:44:24 +05:30
nabarun 58227b68be Changes from review 2022-04-21 09:44:24 +05:30
nabarun 252665512d Add tests for reserving authority with different owner 2022-04-21 09:44:24 +05:30
nabarun 65e90e7af0 Add nameservice tests for reserve and lookup authority 2022-04-21 09:44:24 +05:30
nabarun 36b633b908 Update README with steps to run tests 2022-04-21 09:44:24 +05:30
nabarun df5619932d Add tests for bond refill, withdraw and cancel 2022-04-21 09:44:24 +05:30
nabarun 7fe5bcda83 Add tests for querying bond 2022-04-21 09:44:24 +05:30
nabarun 19d5405087 Implement pattern from dxns-registry-client 2022-04-21 09:44:24 +05:30
nabarun 6bb264d69c Fix create bond message 2022-04-21 09:44:24 +05:30
nabarun 4c3a3558d3 Message for creating bond 2022-04-21 09:44:24 +05:30
nabarun 3f2bdd34f8 Send vote message in gov module 2022-04-21 09:44:24 +05:30
nabarun 72ab467d9b Send tokens using evmosjs and eth-sig-util 2022-04-21 09:44:24 +05:30
nabarun 6871e35964 Add failing test case for sending tokens 2022-04-21 09:44:24 +05:30
143 changed files with 44619 additions and 336 deletions
+1
View File
@@ -0,0 +1 @@
PRIVATE_KEY=75f719e613d05efab06a3f1dde5250b497723b13d4afa4f8ed80145764e40cf7
+2
View File
@@ -1 +1,3 @@
node_modules
dist
.env
+24
View File
@@ -0,0 +1,24 @@
# Development
## Protobuf
Run following scripts when [proto files](./proto/) are updated.
1. Install dependencies
```bash
yarn
```
2. Generate typescript code for the proto files
```bash
./scripts/create-proto-files.sh
```
3. Remove GRPC code from generated code
```bash
./scripts/remove-grpc.sh
```
Reference: https://github.com/tharsis/evmosjs/tree/main/packages/proto#note
+65 -14
View File
@@ -1,6 +1,6 @@
# chiba-clonk-client
# laconic-client
## Development
## Tests
Follow these steps to run the tests:
@@ -10,30 +10,81 @@ Follow these steps to run the tests:
yarn
```
- Clone the [chiba-clonk repo](https://github.com/vulcanize/chiba-clonk) and change directory to repo directory.
- Copy [.env.example](./.env.example) file and create a `.env` file.
- Clone the [laconicd repo](https://github.com/cerc-io/laconicd) and change to repo directory.
- Run the chain using `./init.sh`.
- The mnemonic phrase can be seen in the console at the start just after the script is executed.
- Copy the mnemonic phrase and assign it to variable `MNEMONIC` in the [test file](./src/index.test.ts).
- To export the private key run:
- Export the private key using:
```bash
ethermintd keys export mykey --unarmored-hex --unsafe
laconicd keys export mykey --unarmored-hex --unsafe
```
- Copy the private key and assign it to variable `PRIVATE_KEY` in the [test file](./src/index.test.ts).
- Copy the private key and assign it to variable `PRIVATE_KEY` in the `.env` file.
- Run the test in chiba-clonk-client repo:
- Run the tests in laconic-client repo:
```bash
yarn test
```
- The account details can be seen using
- Run the tests with auctions enabled
```bash
ethermintd keys list
- In laconicd repo run:
```bash
TEST_AUCTION_ENABLED=true ./init.sh
```
- Export the private key and change it in `.env` file again using:
```bash
laconicd keys export mykey --unarmored-hex --unsafe
```
- Run tests:
```bash
yarn test:auctions
```
- Run the tests for record and authority expiry
- In laconicd repo run:
```bash
TEST_NAMESERVICE_EXPIRY=true ./init.sh
```
- Export the private key and change it in `.env` file again using:
```bash
laconicd keys export mykey --unarmored-hex --unsafe
```
- Run tests:
```bash
yarn test:nameservice-expiry
```
## Development
[README](./DEVELOPMENT.md)
## Known Issues
- Passing a float type value in [watcher attributes](./src/testing/data/watcher.yml) throws error when sending `setRecord` message.
```
failed to execute message; message index: 0: Invalid signature.: unauthorized
```
- When sending `setRecord` message, an integer value passed in watcher attributes is parsed as float type in laconicd while [unmarshalling json](https://pkg.go.dev/encoding/json#Unmarshal).
- `setRecord` message throws error when fileds in [Record](./src/types.ts) message are not assigned.
```
failed to pack and hash typedData primary type: provided data '<nil>' doesn't match type 'string' [tharsis/ethermint/ethereum/eip712/eip712.go:33]
```
Passing dummy values to work around issue.
+49
View File
@@ -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;
}
+178
View File
@@ -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;
+183
View File
@@ -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 };
+510
View File
@@ -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;
+57
View File
@@ -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;
};
};
+99
View File
@@ -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',
};
};
+224
View File
@@ -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;
};
};
+338
View File
@@ -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',
};
};
+145
View File
@@ -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;
};
};
+240
View File
@@ -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',
};
};
+41
View File
@@ -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 {};
+20
View File
@@ -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;
+69
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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 = {}));
+1
View File
@@ -0,0 +1 @@
export declare namespace gogoproto { }
+2
View File
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+1
View File
@@ -0,0 +1 @@
export declare namespace google.api { }
+2
View File
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+185
View File
@@ -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;
}
}
+449
View File
@@ -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 = {}));
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+31
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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 = {}));
+85
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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 = {}));
+114
View File
@@ -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
View File
@@ -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;
}
}
File diff suppressed because it is too large Load Diff
+773
View File
@@ -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;
}
}
File diff suppressed because it is too large Load Diff
+422
View File
@@ -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;
}
}
File diff suppressed because it is too large Load Diff
+65
View File
@@ -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>;
}
+409
View File
@@ -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;
+5
View File
@@ -0,0 +1,5 @@
{
"$schema": "http://json-schema.org/schema#",
"id": "/Record",
"type": "object"
}
+19
View File
@@ -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;
};
};
+58
View File
@@ -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;
+9
View File
@@ -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;
};
+21
View File
@@ -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;
+72
View File
@@ -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[];
};
}
+114
View File
@@ -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;
+23
View File
@@ -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>;
}
+145
View File
@@ -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
View File
@@ -2,4 +2,5 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFiles: ["dotenv/config"]
};
+37 -8
View File
@@ -1,20 +1,49 @@
{
"name": "chiba-clonk-client",
"version": "1.0.0",
"main": "index.js",
"repository": "git@github.com:vulcanize/chiba-clonk-client.git",
"author": "contact@deepstacksoft.com",
"name": "laconic-client",
"version": "0.1.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"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",
"dotenv": "^16.0.0",
"jest": "^27.5.1",
"protoc-gen-ts": "^0.8.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"
},
"dependencies": {
"@cosmjs/proto-signing": "^0.28.0",
"@cosmjs/stargate": "^0.28.0"
"@cosmjs/amino": "^0.28.1",
"@cosmjs/crypto": "^0.28.1",
"@cosmjs/encoding": "^0.28.1",
"@ipld/dag-cbor": "^7.0.1",
"@ipld/dag-json": "^8.0.9",
"@metamask/eth-sig-util": "^4.0.0",
"axios": "^0.26.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": "^4.1.0",
"jsonschema": "^1.4.0",
"lodash": "^4.17.21",
"node-yaml": "^4.0.1",
"semver": "^7.3.5",
"tiny-secp256k1": "^2.2.1"
},
"scripts": {
"test": "jest"
"test": "jest --runInBand --verbose",
"test:auctions": "TEST_AUCTIONS_ENABLED=1 jest --runInBand --verbose src/auction.test.ts",
"test:nameservice-expiry": "TEST_NAMESERVICE_EXPIRY=1 jest --runInBand --verbose src/nameservice-expiry.test.ts",
"build": "tsc"
}
}
+137
View File
@@ -0,0 +1,137 @@
syntax = "proto3";
package cosmos.base.abci.v1beta1;
import "gogoproto/gogo.proto";
import "tendermint/abci/types.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/cosmos/cosmos-sdk/types";
option (gogoproto.goproto_stringer_all) = false;
// TxResponse defines a structure containing relevant tx data and metadata. The
// tags are stringified and the log is JSON decoded.
message TxResponse {
option (gogoproto.goproto_getters) = false;
// The block height
int64 height = 1;
// The transaction hash.
string txhash = 2 [(gogoproto.customname) = "TxHash"];
// Namespace for the Code
string codespace = 3;
// Response code.
uint32 code = 4;
// Result bytes, if any.
string data = 5;
// The output of the application's logger (raw string). May be
// non-deterministic.
string raw_log = 6;
// The output of the application's logger (typed). May be non-deterministic.
repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false];
// Additional information. May be non-deterministic.
string info = 8;
// Amount of gas requested for transaction.
int64 gas_wanted = 9;
// Amount of gas consumed by transaction.
int64 gas_used = 10;
// The request transaction bytes.
google.protobuf.Any tx = 11;
// Time of the previous block. For heights > 1, it's the weighted median of
// the timestamps of the valid votes in the block.LastCommit. For height == 1,
// it's genesis time.
string timestamp = 12;
}
// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
message ABCIMessageLog {
option (gogoproto.stringer) = true;
uint32 msg_index = 1;
string log = 2;
// Events contains a slice of Event objects that were emitted during some
// execution.
repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false];
}
// StringEvent defines en Event object wrapper where all the attributes
// contain key/value pairs that are strings instead of raw bytes.
message StringEvent {
option (gogoproto.stringer) = true;
string type = 1;
repeated Attribute attributes = 2 [(gogoproto.nullable) = false];
}
// Attribute defines an attribute wrapper where the key and value are
// strings instead of raw bytes.
message Attribute {
string key = 1;
string value = 2;
}
// GasInfo defines tx execution gas context.
message GasInfo {
// GasWanted is the maximum units of work we allow this tx to perform.
uint64 gas_wanted = 1 [(gogoproto.moretags) = "yaml:\"gas_wanted\""];
// GasUsed is the amount of gas actually consumed.
uint64 gas_used = 2 [(gogoproto.moretags) = "yaml:\"gas_used\""];
}
// Result is the union of ResponseFormat and ResponseCheckTx.
message Result {
option (gogoproto.goproto_getters) = false;
// Data is any data returned from message or handler execution. It MUST be
// length prefixed in order to separate data from multiple message executions.
bytes data = 1;
// Log contains the log information from message or handler execution.
string log = 2;
// Events contains a slice of Event objects that were emitted during message
// or handler execution.
repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false];
}
// SimulationResponse defines the response generated when a transaction is
// successfully simulated.
message SimulationResponse {
GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
Result result = 2;
}
// MsgData defines the data returned in a Result object during message
// execution.
message MsgData {
option (gogoproto.stringer) = true;
string msg_type = 1;
bytes data = 2;
}
// TxMsgData defines a list of MsgData. A transaction will have a MsgData object
// for each message.
message TxMsgData {
option (gogoproto.stringer) = true;
repeated MsgData data = 1;
}
// SearchTxsResult defines a structure for querying txs pageable
message SearchTxsResult {
option (gogoproto.stringer) = true;
// Count of all txs
uint64 total_count = 1 [(gogoproto.moretags) = "yaml:\"total_count\"", (gogoproto.jsontag) = "total_count"];
// Count of txs in current page
uint64 count = 2;
// Index of current page, start from 1
uint64 page_number = 3 [(gogoproto.moretags) = "yaml:\"page_number\"", (gogoproto.jsontag) = "page_number"];
// Count of total pages
uint64 page_total = 4 [(gogoproto.moretags) = "yaml:\"page_total\"", (gogoproto.jsontag) = "page_total"];
// Max count txs per page
uint64 limit = 5;
// List of txs in current page
repeated TxResponse txs = 6;
}
+17
View File
@@ -0,0 +1,17 @@
syntax = "proto3";
package cosmos.base.kv.v1beta1;
import "gogoproto/gogo.proto";
option go_package = "github.com/cosmos/cosmos-sdk/types/kv";
// Pairs defines a repeated slice of Pair objects.
message Pairs {
repeated Pair pairs = 1 [(gogoproto.nullable) = false];
}
// Pair defines a key/value bytes tuple.
message Pair {
bytes key = 1;
bytes value = 2;
}
@@ -0,0 +1,53 @@
syntax = "proto3";
package cosmos.base.query.v1beta1;
option go_package = "github.com/cosmos/cosmos-sdk/types/query";
// PageRequest is to be embedded in gRPC request messages for efficient
// pagination. Ex:
//
// message SomeRequest {
// Foo some_parameter = 1;
// PageRequest pagination = 2;
// }
message PageRequest {
// key is a value returned in PageResponse.next_key to begin
// querying the next page most efficiently. Only one of offset or key
// should be set.
bytes key = 1;
// offset is a numeric offset that can be used when key is unavailable.
// It is less efficient than using key. Only one of offset or key should
// be set.
uint64 offset = 2;
// limit is the total number of results to be returned in the result page.
// If left empty it will default to a value to be set by each app.
uint64 limit = 3;
// count_total is set to true to indicate that the result set should include
// a count of the total number of items available for pagination in UIs.
// count_total is only respected when offset is used. It is ignored when key
// is set.
bool count_total = 4;
// reverse is set to true if results are to be returned in the descending order.
bool reverse = 5;
}
// PageResponse is to be embedded in gRPC response messages where the
// corresponding request message has used PageRequest.
//
// message SomeResponse {
// repeated Bar results = 1;
// PageResponse page = 2;
// }
message PageResponse {
// next_key is the key to be passed to PageRequest.key to
// query the next page most efficiently
bytes next_key = 1;
// total is total number of results available if PageRequest.count_total
// was set, its value is undefined otherwise
uint64 total = 2;
}
@@ -0,0 +1,44 @@
syntax = "proto3";
package cosmos.base.reflection.v1beta1;
import "google/api/annotations.proto";
option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection";
// ReflectionService defines a service for interface reflection.
service ReflectionService {
// ListAllInterfaces lists all the interfaces registered in the interface
// registry.
rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces";
};
// ListImplementations list all the concrete types that implement a given
// interface.
rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/"
"{interface_name}/implementations";
};
}
// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC.
message ListAllInterfacesRequest {}
// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC.
message ListAllInterfacesResponse {
// interface_names is an array of all the registered interfaces.
repeated string interface_names = 1;
}
// ListImplementationsRequest is the request type of the ListImplementations
// RPC.
message ListImplementationsRequest {
// interface_name defines the interface to query the implementations for.
string interface_name = 1;
}
// ListImplementationsResponse is the response type of the ListImplementations
// RPC.
message ListImplementationsResponse {
repeated string implementation_message_names = 1;
}
@@ -0,0 +1,217 @@
syntax = "proto3";
package cosmos.base.reflection.v2alpha1;
import "google/api/annotations.proto";
option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1";
// AppDescriptor describes a cosmos-sdk based application
message AppDescriptor {
// AuthnDescriptor provides information on how to authenticate transactions on the application
// NOTE: experimental and subject to change in future releases.
AuthnDescriptor authn = 1;
// chain provides the chain descriptor
ChainDescriptor chain = 2;
// codec provides metadata information regarding codec related types
CodecDescriptor codec = 3;
// configuration provides metadata information regarding the sdk.Config type
ConfigurationDescriptor configuration = 4;
// query_services provides metadata information regarding the available queriable endpoints
QueryServicesDescriptor query_services = 5;
// tx provides metadata information regarding how to send transactions to the given application
TxDescriptor tx = 6;
}
// TxDescriptor describes the accepted transaction type
message TxDescriptor {
// fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type)
// it is not meant to support polymorphism of transaction types, it is supposed to be used by
// reflection clients to understand if they can handle a specific transaction type in an application.
string fullname = 1;
// msgs lists the accepted application messages (sdk.Msg)
repeated MsgDescriptor msgs = 2;
}
// AuthnDescriptor provides information on how to sign transactions without relying
// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures
message AuthnDescriptor {
// sign_modes defines the supported signature algorithm
repeated SigningModeDescriptor sign_modes = 1;
}
// SigningModeDescriptor provides information on a signing flow of the application
// NOTE(fdymylja): here we could go as far as providing an entire flow on how
// to sign a message given a SigningModeDescriptor, but it's better to think about
// this another time
message SigningModeDescriptor {
// name defines the unique name of the signing mode
string name = 1;
// number is the unique int32 identifier for the sign_mode enum
int32 number = 2;
// authn_info_provider_method_fullname defines the fullname of the method to call to get
// the metadata required to authenticate using the provided sign_modes
string authn_info_provider_method_fullname = 3;
}
// ChainDescriptor describes chain information of the application
message ChainDescriptor {
// id is the chain id
string id = 1;
}
// CodecDescriptor describes the registered interfaces and provides metadata information on the types
message CodecDescriptor {
// interfaces is a list of the registerted interfaces descriptors
repeated InterfaceDescriptor interfaces = 1;
}
// InterfaceDescriptor describes the implementation of an interface
message InterfaceDescriptor {
// fullname is the name of the interface
string fullname = 1;
// interface_accepting_messages contains information regarding the proto messages which contain the interface as
// google.protobuf.Any field
repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2;
// interface_implementers is a list of the descriptors of the interface implementers
repeated InterfaceImplementerDescriptor interface_implementers = 3;
}
// InterfaceImplementerDescriptor describes an interface implementer
message InterfaceImplementerDescriptor {
// fullname is the protobuf queryable name of the interface implementer
string fullname = 1;
// type_url defines the type URL used when marshalling the type as any
// this is required so we can provide type safe google.protobuf.Any marshalling and
// unmarshalling, making sure that we don't accept just 'any' type
// in our interface fields
string type_url = 2;
}
// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains
// an interface represented as a google.protobuf.Any
message InterfaceAcceptingMessageDescriptor {
// fullname is the protobuf fullname of the type containing the interface
string fullname = 1;
// field_descriptor_names is a list of the protobuf name (not fullname) of the field
// which contains the interface as google.protobuf.Any (the interface is the same, but
// it can be in multiple fields of the same proto message)
repeated string field_descriptor_names = 2;
}
// ConfigurationDescriptor contains metadata information on the sdk.Config
message ConfigurationDescriptor {
// bech32_account_address_prefix is the account address prefix
string bech32_account_address_prefix = 1;
}
// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction
message MsgDescriptor {
// msg_type_url contains the TypeURL of a sdk.Msg.
string msg_type_url = 1;
}
// ReflectionService defines a service for application reflection.
service ReflectionService {
// GetAuthnDescriptor returns information on how to authenticate transactions in the application
// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in
// future releases of the cosmos-sdk.
rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn";
}
// GetChainDescriptor returns the description of the chain
rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain";
};
// GetCodecDescriptor returns the descriptor of the codec of the application
rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec";
}
// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application
rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration";
}
// GetQueryServicesDescriptor returns the available gRPC queryable services of the application
rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services";
}
// GetTxDescriptor returns information on the used transaction object and available msgs that can be used
rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor";
}
}
// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC
message GetAuthnDescriptorRequest {}
// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC
message GetAuthnDescriptorResponse {
// authn describes how to authenticate to the application when sending transactions
AuthnDescriptor authn = 1;
}
// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC
message GetChainDescriptorRequest {}
// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC
message GetChainDescriptorResponse {
// chain describes application chain information
ChainDescriptor chain = 1;
}
// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC
message GetCodecDescriptorRequest {}
// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC
message GetCodecDescriptorResponse {
// codec describes the application codec such as registered interfaces and implementations
CodecDescriptor codec = 1;
}
// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC
message GetConfigurationDescriptorRequest {}
// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC
message GetConfigurationDescriptorResponse {
// config describes the application's sdk.Config
ConfigurationDescriptor config = 1;
}
// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC
message GetQueryServicesDescriptorRequest {}
// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC
message GetQueryServicesDescriptorResponse {
// queries provides information on the available queryable services
QueryServicesDescriptor queries = 1;
}
// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC
message GetTxDescriptorRequest {}
// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC
message GetTxDescriptorResponse {
// tx provides information on msgs that can be forwarded to the application
// alongside the accepted transaction protobuf type
TxDescriptor tx = 1;
}
// QueryServicesDescriptor contains the list of cosmos-sdk queriable services
message QueryServicesDescriptor {
// query_services is a list of cosmos-sdk QueryServiceDescriptor
repeated QueryServiceDescriptor query_services = 1;
}
// QueryServiceDescriptor describes a cosmos-sdk queryable service
message QueryServiceDescriptor {
// fullname is the protobuf fullname of the service descriptor
string fullname = 1;
// is_module describes if this service is actually exposed by an application's module
bool is_module = 2;
// methods provides a list of query service methods
repeated QueryMethodDescriptor methods = 3;
}
// QueryMethodDescriptor describes a queryable method of a query service
// no other info is provided beside method name and tendermint queryable path
// because it would be redundant with the grpc reflection service
message QueryMethodDescriptor {
// name is the protobuf name (not fullname) of the method
string name = 1;
// full_query_path is the path that can be used to query
// this method via tendermint abci.Query
string full_query_path = 2;
}
@@ -0,0 +1,20 @@
syntax = "proto3";
package cosmos.base.snapshots.v1beta1;
import "gogoproto/gogo.proto";
option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types";
// Snapshot contains Tendermint state sync snapshot info.
message Snapshot {
uint64 height = 1;
uint32 format = 2;
uint32 chunks = 3;
bytes hash = 4;
Metadata metadata = 5 [(gogoproto.nullable) = false];
}
// Metadata contains SDK-specific snapshot metadata.
message Metadata {
repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes
}
@@ -0,0 +1,29 @@
syntax = "proto3";
package cosmos.base.store.v1beta1;
import "gogoproto/gogo.proto";
option go_package = "github.com/cosmos/cosmos-sdk/store/types";
// CommitInfo defines commit information used by the multi-store when committing
// a version/height.
message CommitInfo {
int64 version = 1;
repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false];
}
// StoreInfo defines store-specific commit information. It contains a reference
// between a store name and the commit ID.
message StoreInfo {
string name = 1;
CommitID commit_id = 2 [(gogoproto.nullable) = false];
}
// CommitID defines the committment information when a specific store is
// committed.
message CommitID {
option (gogoproto.goproto_stringer) = false;
int64 version = 1;
bytes hash = 2;
}
@@ -0,0 +1,14 @@
syntax = "proto3";
package cosmos.base.store.v1beta1;
option go_package = "github.com/cosmos/cosmos-sdk/store/types";
// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes)
// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and
// Deletes
message StoreKVPair {
string store_key = 1; // the store key for the KVStore this pair originates from
bool delete = 2; // true indicates a delete operation, false indicates a set operation
bytes key = 3;
bytes value = 4;
}
@@ -0,0 +1,28 @@
syntax = "proto3";
package cosmos.base.store.v1beta1;
import "gogoproto/gogo.proto";
option go_package = "github.com/cosmos/cosmos-sdk/store/types";
// SnapshotItem is an item contained in a rootmulti.Store snapshot.
message SnapshotItem {
// item is the specific type of snapshot item.
oneof item {
SnapshotStoreItem store = 1;
SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"];
}
}
// SnapshotStoreItem contains metadata about a snapshotted store.
message SnapshotStoreItem {
string name = 1;
}
// SnapshotIAVLItem is an exported IAVL node.
message SnapshotIAVLItem {
bytes key = 1;
bytes value = 2;
int64 version = 3;
int32 height = 4;
}
@@ -0,0 +1,136 @@
syntax = "proto3";
package cosmos.base.tendermint.v1beta1;
import "google/protobuf/any.proto";
import "google/api/annotations.proto";
import "tendermint/p2p/types.proto";
import "tendermint/types/block.proto";
import "tendermint/types/types.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice";
// Service defines the gRPC querier service for tendermint queries.
service Service {
// GetNodeInfo queries the current node info.
rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) {
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info";
}
// GetSyncing queries node syncing.
rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) {
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing";
}
// GetLatestBlock returns the latest block.
rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) {
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest";
}
// GetBlockByHeight queries block for given height.
rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) {
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}";
}
// GetLatestValidatorSet queries latest validator-set.
rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) {
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest";
}
// GetValidatorSetByHeight queries validator-set at a given height.
rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) {
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}";
}
}
// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method.
message GetValidatorSetByHeightRequest {
int64 height = 1;
// pagination defines an pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method.
message GetValidatorSetByHeightResponse {
int64 block_height = 1;
repeated Validator validators = 2;
// pagination defines an pagination for the response.
cosmos.base.query.v1beta1.PageResponse pagination = 3;
}
// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method.
message GetLatestValidatorSetRequest {
// pagination defines an pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method.
message GetLatestValidatorSetResponse {
int64 block_height = 1;
repeated Validator validators = 2;
// pagination defines an pagination for the response.
cosmos.base.query.v1beta1.PageResponse pagination = 3;
}
// Validator is the type for the validator-set.
message Validator {
string address = 1;
google.protobuf.Any pub_key = 2;
int64 voting_power = 3;
int64 proposer_priority = 4;
}
// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method.
message GetBlockByHeightRequest {
int64 height = 1;
}
// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method.
message GetBlockByHeightResponse {
.tendermint.types.BlockID block_id = 1;
.tendermint.types.Block block = 2;
}
// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method.
message GetLatestBlockRequest {}
// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method.
message GetLatestBlockResponse {
.tendermint.types.BlockID block_id = 1;
.tendermint.types.Block block = 2;
}
// GetSyncingRequest is the request type for the Query/GetSyncing RPC method.
message GetSyncingRequest {}
// GetSyncingResponse is the response type for the Query/GetSyncing RPC method.
message GetSyncingResponse {
bool syncing = 1;
}
// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method.
message GetNodeInfoRequest {}
// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method.
message GetNodeInfoResponse {
.tendermint.p2p.DefaultNodeInfo default_node_info = 1;
VersionInfo application_version = 2;
}
// VersionInfo is the type for the GetNodeInfoResponse message.
message VersionInfo {
string name = 1;
string app_name = 2;
string version = 3;
string git_commit = 4;
string build_tags = 5;
string go_version = 6;
repeated Module build_deps = 7;
string cosmos_sdk_version = 8;
}
// Module is the type for VersionInfo
message Module {
// module path
string path = 1;
// module version
string version = 2;
// checksum
string sum = 3;
}
+40
View File
@@ -0,0 +1,40 @@
syntax = "proto3";
package cosmos.base.v1beta1;
import "gogoproto/gogo.proto";
option go_package = "github.com/cosmos/cosmos-sdk/types";
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = false;
// Coin defines a token with a denomination and an amount.
//
// NOTE: The amount field is an Int which implements the custom method
// signatures required by gogoproto.
message Coin {
option (gogoproto.equal) = true;
string denom = 1;
string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
}
// DecCoin defines a token with a denomination and a decimal amount.
//
// NOTE: The amount field is an Dec which implements the custom method
// signatures required by gogoproto.
message DecCoin {
option (gogoproto.equal) = true;
string denom = 1;
string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
}
// IntProto defines a Protobuf wrapper around an Int object.
message IntProto {
string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
}
// DecProto defines a Protobuf wrapper around a Dec object.
message DecProto {
string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
}
+145
View File
@@ -0,0 +1,145 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2";
package gogoproto;
import "google/protobuf/descriptor.proto";
option java_package = "com.google.protobuf";
option java_outer_classname = "GoGoProtos";
option go_package = "github.com/gogo/protobuf/gogoproto";
extend google.protobuf.EnumOptions {
optional bool goproto_enum_prefix = 62001;
optional bool goproto_enum_stringer = 62021;
optional bool enum_stringer = 62022;
optional string enum_customname = 62023;
optional bool enumdecl = 62024;
}
extend google.protobuf.EnumValueOptions {
optional string enumvalue_customname = 66001;
}
extend google.protobuf.FileOptions {
optional bool goproto_getters_all = 63001;
optional bool goproto_enum_prefix_all = 63002;
optional bool goproto_stringer_all = 63003;
optional bool verbose_equal_all = 63004;
optional bool face_all = 63005;
optional bool gostring_all = 63006;
optional bool populate_all = 63007;
optional bool stringer_all = 63008;
optional bool onlyone_all = 63009;
optional bool equal_all = 63013;
optional bool description_all = 63014;
optional bool testgen_all = 63015;
optional bool benchgen_all = 63016;
optional bool marshaler_all = 63017;
optional bool unmarshaler_all = 63018;
optional bool stable_marshaler_all = 63019;
optional bool sizer_all = 63020;
optional bool goproto_enum_stringer_all = 63021;
optional bool enum_stringer_all = 63022;
optional bool unsafe_marshaler_all = 63023;
optional bool unsafe_unmarshaler_all = 63024;
optional bool goproto_extensions_map_all = 63025;
optional bool goproto_unrecognized_all = 63026;
optional bool gogoproto_import = 63027;
optional bool protosizer_all = 63028;
optional bool compare_all = 63029;
optional bool typedecl_all = 63030;
optional bool enumdecl_all = 63031;
optional bool goproto_registration = 63032;
optional bool messagename_all = 63033;
optional bool goproto_sizecache_all = 63034;
optional bool goproto_unkeyed_all = 63035;
}
extend google.protobuf.MessageOptions {
optional bool goproto_getters = 64001;
optional bool goproto_stringer = 64003;
optional bool verbose_equal = 64004;
optional bool face = 64005;
optional bool gostring = 64006;
optional bool populate = 64007;
optional bool stringer = 67008;
optional bool onlyone = 64009;
optional bool equal = 64013;
optional bool description = 64014;
optional bool testgen = 64015;
optional bool benchgen = 64016;
optional bool marshaler = 64017;
optional bool unmarshaler = 64018;
optional bool stable_marshaler = 64019;
optional bool sizer = 64020;
optional bool unsafe_marshaler = 64023;
optional bool unsafe_unmarshaler = 64024;
optional bool goproto_extensions_map = 64025;
optional bool goproto_unrecognized = 64026;
optional bool protosizer = 64028;
optional bool compare = 64029;
optional bool typedecl = 64030;
optional bool messagename = 64033;
optional bool goproto_sizecache = 64034;
optional bool goproto_unkeyed = 64035;
}
extend google.protobuf.FieldOptions {
optional bool nullable = 65001;
optional bool embed = 65002;
optional string customtype = 65003;
optional string customname = 65004;
optional string jsontag = 65005;
optional string moretags = 65006;
optional string casttype = 65007;
optional string castkey = 65008;
optional string castvalue = 65009;
optional bool stdtime = 65010;
optional bool stdduration = 65011;
optional bool wktpointer = 65012;
optional string castrepeated = 65013;
}
+31
View File
@@ -0,0 +1,31 @@
// Copyright (c) 2015, Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.api;
import "google/api/http.proto";
import "google/protobuf/descriptor.proto";
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
extend google.protobuf.MethodOptions {
// See `HttpRule`.
HttpRule http = 72295728;
}
+325
View File
@@ -0,0 +1,325 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.api;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
option java_multiple_files = true;
option java_outer_classname = "HttpProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Defines the HTTP configuration for an API service. It contains a list of
// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
// to one or more HTTP REST API methods.
message Http {
// A list of HTTP configuration rules that apply to individual API methods.
//
// **NOTE:** All service configuration rules follow "last one wins" order.
repeated HttpRule rules = 1;
// When set to true, URL path parmeters will be fully URI-decoded except in
// cases of single segment matches in reserved expansion, where "%2F" will be
// left encoded.
//
// The default behavior is to not decode RFC 6570 reserved characters in multi
// segment matches.
bool fully_decode_reserved_expansion = 2;
}
// `HttpRule` defines the mapping of an RPC method to one or more HTTP
// REST API methods. The mapping specifies how different portions of the RPC
// request message are mapped to URL path, URL query parameters, and
// HTTP request body. The mapping is typically specified as an
// `google.api.http` annotation on the RPC method,
// see "google/api/annotations.proto" for details.
//
// The mapping consists of a field specifying the path template and
// method kind. The path template can refer to fields in the request
// message, as in the example below which describes a REST GET
// operation on a resource collection of messages:
//
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http).get =
// "/v1/messages/{message_id}/{sub.subfield}";
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // mapped to the URL
// SubMessage sub = 2; // `sub.subfield` is url-mapped
// }
// message Message {
// string text = 1; // content of the resource
// }
//
// The same http annotation can alternatively be expressed inside the
// `GRPC API Configuration` YAML file.
//
// http:
// rules:
// - selector: <proto_package_name>.Messaging.GetMessage
// get: /v1/messages/{message_id}/{sub.subfield}
//
// This definition enables an automatic, bidrectional mapping of HTTP
// JSON to RPC. Example:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub:
// SubMessage(subfield: "foo"))`
//
// In general, not only fields but also field paths can be referenced
// from a path pattern. Fields mapped to the path pattern cannot be
// repeated and must have a primitive (non-message) type.
//
// Any fields in the request message which are not bound by the path
// pattern automatically become (optional) HTTP query
// parameters. Assume the following definition of the request message:
//
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http).get = "/v1/messages/{message_id}";
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // mapped to the URL
// int64 revision = 2; // becomes a parameter
// SubMessage sub = 3; // `sub.subfield` becomes a parameter
// }
//
//
// This enables a HTTP JSON to RPC mapping as below:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
// "foo"))`
//
// Note that fields which are mapped to HTTP parameters must have a
// primitive type or a repeated primitive type. Message types are not
// allowed. In the case of a repeated type, the parameter can be
// repeated in the URL, as in `...?param=A&param=B`.
//
// For HTTP method kinds which allow a request body, the `body` field
// specifies the mapping. Consider a REST update method on the
// message resource collection:
//
//
// service Messaging {
// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
// option (google.api.http) = {
// put: "/v1/messages/{message_id}"
// body: "message"
// };
// }
// }
// message UpdateMessageRequest {
// string message_id = 1; // mapped to the URL
// Message message = 2; // mapped to the body
// }
//
//
// The following HTTP JSON to RPC mapping is enabled, where the
// representation of the JSON in the request body is determined by
// protos JSON encoding:
//
// HTTP | RPC
// -----|-----
// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
// "123456" message { text: "Hi!" })`
//
// The special name `*` can be used in the body mapping to define that
// every field not bound by the path template should be mapped to the
// request body. This enables the following alternative definition of
// the update method:
//
// service Messaging {
// rpc UpdateMessage(Message) returns (Message) {
// option (google.api.http) = {
// put: "/v1/messages/{message_id}"
// body: "*"
// };
// }
// }
// message Message {
// string message_id = 1;
// string text = 2;
// }
//
//
// The following HTTP JSON to RPC mapping is enabled:
//
// HTTP | RPC
// -----|-----
// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
// "123456" text: "Hi!")`
//
// Note that when using `*` in the body mapping, it is not possible to
// have HTTP parameters, as all fields not bound by the path end in
// the body. This makes this option more rarely used in practice of
// defining REST APIs. The common usage of `*` is in custom methods
// which don't use the URL at all for transferring data.
//
// It is possible to define multiple HTTP methods for one RPC by using
// the `additional_bindings` option. Example:
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http) = {
// get: "/v1/messages/{message_id}"
// additional_bindings {
// get: "/v1/users/{user_id}/messages/{message_id}"
// }
// };
// }
// }
// message GetMessageRequest {
// string message_id = 1;
// string user_id = 2;
// }
//
//
// This enables the following two alternative HTTP JSON to RPC
// mappings:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
// "123456")`
//
// # Rules for HTTP mapping
//
// The rules for mapping HTTP path, query parameters, and body fields
// to the request message are as follows:
//
// 1. The `body` field specifies either `*` or a field path, or is
// omitted. If omitted, it indicates there is no HTTP request body.
// 2. Leaf fields (recursive expansion of nested messages in the
// request) can be classified into three types:
// (a) Matched in the URL template.
// (b) Covered by body (if body is `*`, everything except (a) fields;
// else everything under the body field)
// (c) All other fields.
// 3. URL query parameters found in the HTTP request are mapped to (c) fields.
// 4. Any body sent with an HTTP request can contain only (b) fields.
//
// The syntax of the path template is as follows:
//
// Template = "/" Segments [ Verb ] ;
// Segments = Segment { "/" Segment } ;
// Segment = "*" | "**" | LITERAL | Variable ;
// Variable = "{" FieldPath [ "=" Segments ] "}" ;
// FieldPath = IDENT { "." IDENT } ;
// Verb = ":" LITERAL ;
//
// The syntax `*` matches a single path segment. The syntax `**` matches zero
// or more path segments, which must be the last part of the path except the
// `Verb`. The syntax `LITERAL` matches literal text in the path.
//
// The syntax `Variable` matches part of the URL path as specified by its
// template. A variable template must not contain other variables. If a variable
// matches a single path segment, its template may be omitted, e.g. `{var}`
// is equivalent to `{var=*}`.
//
// If a variable contains exactly one path segment, such as `"{var}"` or
// `"{var=*}"`, when such a variable is expanded into a URL path, all characters
// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
// Discovery Document as `{var}`.
//
// If a variable contains one or more path segments, such as `"{var=foo/*}"`
// or `"{var=**}"`, when such a variable is expanded into a URL path, all
// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
// show up in the Discovery Document as `{+var}`.
//
// NOTE: While the single segment variable matches the semantics of
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
// Simple String Expansion, the multi segment variable **does not** match
// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
// does not expand special characters like `?` and `#`, which would lead
// to invalid URLs.
//
// NOTE: the field paths in variables and in the `body` must not refer to
// repeated fields or map fields.
message HttpRule {
// Selects methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
// details.
string selector = 1;
// Determines the URL pattern is matched by this rules. This pattern can be
// used with any of the {get|put|post|delete|patch} methods. A custom method
// can be defined using the 'custom' field.
oneof pattern {
// Used for listing and getting information about resources.
string get = 2;
// Used for updating a resource.
string put = 3;
// Used for creating a resource.
string post = 4;
// Used for deleting a resource.
string delete = 5;
// Used for updating a resource.
string patch = 6;
// The custom pattern is used for specifying an HTTP method that is not
// included in the `pattern` field, such as HEAD, or "*" to leave the
// HTTP method unspecified for this rule. The wild-card rule is useful
// for services that provide content to Web (HTML) clients.
CustomHttpPattern custom = 8;
}
// The name of the request field whose value is mapped to the HTTP body, or
// `*` for mapping all fields not captured by the path pattern to the HTTP
// body. NOTE: the referred field must not be a repeated field and must be
// present at the top-level of request message type.
string body = 7;
// Optional. The name of the response field whose value is mapped to the HTTP
// body of response. Other response fields are ignored. When
// not set, the response message will be used as HTTP body of response.
string response_body = 12;
// Additional HTTP bindings for the selector. Nested bindings must
// not contain an `additional_bindings` field themselves (that is,
// the nesting may only be one level deep).
repeated HttpRule additional_bindings = 11;
}
// A custom pattern is used for defining custom HTTP verb.
message CustomHttpPattern {
// The name of this custom HTTP verb.
string kind = 1;
// The path matched by this custom verb.
string path = 2;
}
+78
View File
@@ -0,0 +1,78 @@
// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.api;
import "google/protobuf/any.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
option java_multiple_files = true;
option java_outer_classname = "HttpBodyProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";
// Message that represents an arbitrary HTTP body. It should only be used for
// payload formats that can't be represented as JSON, such as raw binary or
// an HTML page.
//
//
// This message can be used both in streaming and non-streaming API methods in
// the request as well as the response.
//
// It can be used as a top-level request field, which is convenient if one
// wants to extract parameters from either the URL or HTTP template into the
// request fields and also want access to the raw HTTP body.
//
// Example:
//
// message GetResourceRequest {
// // A unique request id.
// string request_id = 1;
//
// // The raw HTTP body is bound to this field.
// google.api.HttpBody http_body = 2;
// }
//
// service ResourceService {
// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
// rpc UpdateResource(google.api.HttpBody) returns
// (google.protobuf.Empty);
// }
//
// Example with streaming methods:
//
// service CaldavService {
// rpc GetCalendar(stream google.api.HttpBody)
// returns (stream google.api.HttpBody);
// rpc UpdateCalendar(stream google.api.HttpBody)
// returns (stream google.api.HttpBody);
// }
//
// Use of this type only changes how the request and response bodies are
// handled, all other features will continue to work unchanged.
message HttpBody {
// The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
// The HTTP request/response body as raw binary.
bytes data = 2;
// Application specific response metadata. Must be set in the first response
// for streaming APIs.
repeated google.protobuf.Any extensions = 3;
}
+161
View File
@@ -0,0 +1,161 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package google.protobuf;
import "gogoproto/gogo.proto";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option go_package = "types";
option java_package = "com.google.protobuf";
option java_outer_classname = "AnyProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
// `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
//
// Protobuf library provides support to pack/unpack Any values in the form
// of utility functions or additional generated methods of the Any type.
//
// Example 1: Pack and unpack a message in C++.
//
// Foo foo = ...;
// Any any;
// any.PackFrom(foo);
// ...
// if (any.UnpackTo(&foo)) {
// ...
// }
//
// Example 2: Pack and unpack a message in Java.
//
// Foo foo = ...;
// Any any = Any.pack(foo);
// ...
// if (any.is(Foo.class)) {
// foo = any.unpack(Foo.class);
// }
//
// Example 3: Pack and unpack a message in Python.
//
// foo = Foo(...)
// any = Any()
// any.Pack(foo)
// ...
// if any.Is(Foo.DESCRIPTOR):
// any.Unpack(foo)
// ...
//
// Example 4: Pack and unpack a message in Go
//
// foo := &pb.Foo{...}
// any, err := ptypes.MarshalAny(foo)
// ...
// foo := &pb.Foo{}
// if err := ptypes.UnmarshalAny(any, foo); err != nil {
// ...
// }
//
// The pack methods provided by protobuf library will by default use
// 'type.googleapis.com/full.type.name' as the type URL and the unpack
// methods only use the fully qualified type name after the last '/'
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
// name "y.z".
//
//
// JSON
// ====
// The JSON representation of an `Any` value uses the regular
// representation of the deserialized, embedded message, with an
// additional field `@type` which contains the type URL. Example:
//
// package google.profile;
// message Person {
// string first_name = 1;
// string last_name = 2;
// }
//
// {
// "@type": "type.googleapis.com/google.profile.Person",
// "firstName": <string>,
// "lastName": <string>
// }
//
// If the embedded message type is well-known and has a custom JSON
// representation, that representation will be embedded adding a field
// `value` which holds the custom JSON in addition to the `@type`
// field. Example (for message [google.protobuf.Duration][]):
//
// {
// "@type": "type.googleapis.com/google.protobuf.Duration",
// "value": "1.212s"
// }
//
message Any {
// A URL/resource name that uniquely identifies the type of the serialized
// protocol buffer message. This string must contain at least
// one "/" character. The last segment of the URL's path must represent
// the fully qualified name of the type (as in
// `path/google.protobuf.Duration`). The name should be in a canonical form
// (e.g., leading "." is not accepted).
//
// In practice, teams usually precompile into the binary all types that they
// expect it to use in the context of Any. However, for URLs which use the
// scheme `http`, `https`, or no scheme, one can optionally set up a type
// server that maps type URLs to message definitions as follows:
//
// * If no scheme is provided, `https` is assumed.
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
// URL, or have them precompiled into a binary to avoid any
// lookup. Therefore, binary compatibility needs to be preserved
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
// Note: this functionality is not currently available in the official
// protobuf release, and it is not used for type URLs beginning with
// type.googleapis.com.
//
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
//
string type_url = 1;
// Must be a valid serialized protocol buffer of the above specified type.
bytes value = 2;
option (gogoproto.typedecl) = false;
}
option (gogoproto.goproto_registration) = false;
+895
View File
@@ -0,0 +1,895 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Author: kenton@google.com (Kenton Varda)
// Based on original Protocol Buffers design by
// Sanjay Ghemawat, Jeff Dean, and others.
//
// The messages in this file describe the definitions found in .proto files.
// A valid .proto file can be translated directly to a FileDescriptorProto
// without any other information (e.g. without reading its imports).
syntax = "proto2";
package google.protobuf;
option go_package = "google.golang.org/protobuf/types/descriptorpb";
option java_package = "com.google.protobuf";
option java_outer_classname = "DescriptorProtos";
option csharp_namespace = "Google.Protobuf.Reflection";
option objc_class_prefix = "GPB";
option cc_enable_arenas = true;
// descriptor.proto must be optimized for speed because reflection-based
// algorithms don't work during bootstrapping.
option optimize_for = SPEED;
// The protocol compiler can output a FileDescriptorSet containing the .proto
// files it parses.
message FileDescriptorSet {
repeated FileDescriptorProto file = 1;
}
// Describes a complete .proto file.
message FileDescriptorProto {
optional string name = 1; // file name, relative to root of source tree
optional string package = 2; // e.g. "foo", "foo.bar", etc.
// Names of files imported by this file.
repeated string dependency = 3;
// Indexes of the public imported files in the dependency list above.
repeated int32 public_dependency = 10;
// Indexes of the weak imported files in the dependency list.
// For Google-internal migration only. Do not use.
repeated int32 weak_dependency = 11;
// All top-level definitions in this file.
repeated DescriptorProto message_type = 4;
repeated EnumDescriptorProto enum_type = 5;
repeated ServiceDescriptorProto service = 6;
repeated FieldDescriptorProto extension = 7;
optional FileOptions options = 8;
// This field contains optional information about the original source code.
// You may safely remove this entire field without harming runtime
// functionality of the descriptors -- the information is needed only by
// development tools.
optional SourceCodeInfo source_code_info = 9;
// The syntax of the proto file.
// The supported values are "proto2" and "proto3".
optional string syntax = 12;
}
// Describes a message type.
message DescriptorProto {
optional string name = 1;
repeated FieldDescriptorProto field = 2;
repeated FieldDescriptorProto extension = 6;
repeated DescriptorProto nested_type = 3;
repeated EnumDescriptorProto enum_type = 4;
message ExtensionRange {
optional int32 start = 1; // Inclusive.
optional int32 end = 2; // Exclusive.
optional ExtensionRangeOptions options = 3;
}
repeated ExtensionRange extension_range = 5;
repeated OneofDescriptorProto oneof_decl = 8;
optional MessageOptions options = 7;
// Range of reserved tag numbers. Reserved tag numbers may not be used by
// fields or extension ranges in the same message. Reserved ranges may
// not overlap.
message ReservedRange {
optional int32 start = 1; // Inclusive.
optional int32 end = 2; // Exclusive.
}
repeated ReservedRange reserved_range = 9;
// Reserved field names, which may not be used by fields in the same message.
// A given name may only be reserved once.
repeated string reserved_name = 10;
}
message ExtensionRangeOptions {
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
// Describes a field within a message.
message FieldDescriptorProto {
enum Type {
// 0 is reserved for errors.
// Order is weird for historical reasons.
TYPE_DOUBLE = 1;
TYPE_FLOAT = 2;
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
// negative values are likely.
TYPE_INT64 = 3;
TYPE_UINT64 = 4;
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
// negative values are likely.
TYPE_INT32 = 5;
TYPE_FIXED64 = 6;
TYPE_FIXED32 = 7;
TYPE_BOOL = 8;
TYPE_STRING = 9;
// Tag-delimited aggregate.
// Group type is deprecated and not supported in proto3. However, Proto3
// implementations should still be able to parse the group wire format and
// treat group fields as unknown fields.
TYPE_GROUP = 10;
TYPE_MESSAGE = 11; // Length-delimited aggregate.
// New in version 2.
TYPE_BYTES = 12;
TYPE_UINT32 = 13;
TYPE_ENUM = 14;
TYPE_SFIXED32 = 15;
TYPE_SFIXED64 = 16;
TYPE_SINT32 = 17; // Uses ZigZag encoding.
TYPE_SINT64 = 18; // Uses ZigZag encoding.
}
enum Label {
// 0 is reserved for errors
LABEL_OPTIONAL = 1;
LABEL_REQUIRED = 2;
LABEL_REPEATED = 3;
}
optional string name = 1;
optional int32 number = 3;
optional Label label = 4;
// If type_name is set, this need not be set. If both this and type_name
// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
optional Type type = 5;
// For message and enum types, this is the name of the type. If the name
// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
// rules are used to find the type (i.e. first the nested types within this
// message are searched, then within the parent, on up to the root
// namespace).
optional string type_name = 6;
// For extensions, this is the name of the type being extended. It is
// resolved in the same manner as type_name.
optional string extendee = 2;
// For numeric types, contains the original text representation of the value.
// For booleans, "true" or "false".
// For strings, contains the default text contents (not escaped in any way).
// For bytes, contains the C escaped value. All bytes >= 128 are escaped.
// TODO(kenton): Base-64 encode?
optional string default_value = 7;
// If set, gives the index of a oneof in the containing type's oneof_decl
// list. This field is a member of that oneof.
optional int32 oneof_index = 9;
// JSON name of this field. The value is set by protocol compiler. If the
// user has set a "json_name" option on this field, that option's value
// will be used. Otherwise, it's deduced from the field's name by converting
// it to camelCase.
optional string json_name = 10;
optional FieldOptions options = 8;
// If true, this is a proto3 "optional". When a proto3 field is optional, it
// tracks presence regardless of field type.
//
// When proto3_optional is true, this field must be belong to a oneof to
// signal to old proto3 clients that presence is tracked for this field. This
// oneof is known as a "synthetic" oneof, and this field must be its sole
// member (each proto3 optional field gets its own synthetic oneof). Synthetic
// oneofs exist in the descriptor only, and do not generate any API. Synthetic
// oneofs must be ordered after all "real" oneofs.
//
// For message fields, proto3_optional doesn't create any semantic change,
// since non-repeated message fields always track presence. However it still
// indicates the semantic detail of whether the user wrote "optional" or not.
// This can be useful for round-tripping the .proto file. For consistency we
// give message fields a synthetic oneof also, even though it is not required
// to track presence. This is especially important because the parser can't
// tell if a field is a message or an enum, so it must always create a
// synthetic oneof.
//
// Proto2 optional fields do not set this flag, because they already indicate
// optional with `LABEL_OPTIONAL`.
optional bool proto3_optional = 17;
}
// Describes a oneof.
message OneofDescriptorProto {
optional string name = 1;
optional OneofOptions options = 2;
}
// Describes an enum type.
message EnumDescriptorProto {
optional string name = 1;
repeated EnumValueDescriptorProto value = 2;
optional EnumOptions options = 3;
// Range of reserved numeric values. Reserved values may not be used by
// entries in the same enum. Reserved ranges may not overlap.
//
// Note that this is distinct from DescriptorProto.ReservedRange in that it
// is inclusive such that it can appropriately represent the entire int32
// domain.
message EnumReservedRange {
optional int32 start = 1; // Inclusive.
optional int32 end = 2; // Inclusive.
}
// Range of reserved numeric values. Reserved numeric values may not be used
// by enum values in the same enum declaration. Reserved ranges may not
// overlap.
repeated EnumReservedRange reserved_range = 4;
// Reserved enum value names, which may not be reused. A given name may only
// be reserved once.
repeated string reserved_name = 5;
}
// Describes a value within an enum.
message EnumValueDescriptorProto {
optional string name = 1;
optional int32 number = 2;
optional EnumValueOptions options = 3;
}
// Describes a service.
message ServiceDescriptorProto {
optional string name = 1;
repeated MethodDescriptorProto method = 2;
optional ServiceOptions options = 3;
}
// Describes a method of a service.
message MethodDescriptorProto {
optional string name = 1;
// Input and output type names. These are resolved in the same way as
// FieldDescriptorProto.type_name, but must refer to a message type.
optional string input_type = 2;
optional string output_type = 3;
optional MethodOptions options = 4;
// Identifies if client streams multiple client messages
optional bool client_streaming = 5 [default = false];
// Identifies if server streams multiple server messages
optional bool server_streaming = 6 [default = false];
}
// ===================================================================
// Options
// Each of the definitions above may have "options" attached. These are
// just annotations which may cause code to be generated slightly differently
// or may contain hints for code that manipulates protocol messages.
//
// Clients may define custom options as extensions of the *Options messages.
// These extensions may not yet be known at parsing time, so the parser cannot
// store the values in them. Instead it stores them in a field in the *Options
// message called uninterpreted_option. This field must have the same name
// across all *Options messages. We then use this field to populate the
// extensions when we build a descriptor, at which point all protos have been
// parsed and so all extensions are known.
//
// Extension numbers for custom options may be chosen as follows:
// * For options which will only be used within a single application or
// organization, or for experimental options, use field numbers 50000
// through 99999. It is up to you to ensure that you do not use the
// same number for multiple options.
// * For options which will be published and used publicly by multiple
// independent entities, e-mail protobuf-global-extension-registry@google.com
// to reserve extension numbers. Simply provide your project name (e.g.
// Objective-C plugin) and your project website (if available) -- there's no
// need to explain how you intend to use them. Usually you only need one
// extension number. You can declare multiple options with only one extension
// number by putting them in a sub-message. See the Custom Options section of
// the docs for examples:
// https://developers.google.com/protocol-buffers/docs/proto#options
// If this turns out to be popular, a web service will be set up
// to automatically assign option numbers.
message FileOptions {
// Sets the Java package where classes generated from this .proto will be
// placed. By default, the proto package is used, but this is often
// inappropriate because proto packages do not normally start with backwards
// domain names.
optional string java_package = 1;
// If set, all the classes from the .proto file are wrapped in a single
// outer class with the given name. This applies to both Proto1
// (equivalent to the old "--one_java_file" option) and Proto2 (where
// a .proto always translates to a single class, but you may want to
// explicitly choose the class name).
optional string java_outer_classname = 8;
// If set true, then the Java code generator will generate a separate .java
// file for each top-level message, enum, and service defined in the .proto
// file. Thus, these types will *not* be nested inside the outer class
// named by java_outer_classname. However, the outer class will still be
// generated to contain the file's getDescriptor() method as well as any
// top-level extensions defined in the file.
optional bool java_multiple_files = 10 [default = false];
// This option does nothing.
optional bool java_generate_equals_and_hash = 20 [deprecated = true];
// If set true, then the Java2 code generator will generate code that
// throws an exception whenever an attempt is made to assign a non-UTF-8
// byte sequence to a string field.
// Message reflection will do the same.
// However, an extension field still accepts non-UTF-8 byte sequences.
// This option has no effect on when used with the lite runtime.
optional bool java_string_check_utf8 = 27 [default = false];
// Generated classes can be optimized for speed or code size.
enum OptimizeMode {
SPEED = 1; // Generate complete code for parsing, serialization,
// etc.
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
}
optional OptimizeMode optimize_for = 9 [default = SPEED];
// Sets the Go package where structs generated from this .proto will be
// placed. If omitted, the Go package will be derived from the following:
// - The basename of the package import path, if provided.
// - Otherwise, the package statement in the .proto file, if present.
// - Otherwise, the basename of the .proto file, without extension.
optional string go_package = 11;
// Should generic services be generated in each language? "Generic" services
// are not specific to any particular RPC system. They are generated by the
// main code generators in each language (without additional plugins).
// Generic services were the only kind of service generation supported by
// early versions of google.protobuf.
//
// Generic services are now considered deprecated in favor of using plugins
// that generate code specific to your particular RPC system. Therefore,
// these default to false. Old code which depends on generic services should
// explicitly set them to true.
optional bool cc_generic_services = 16 [default = false];
optional bool java_generic_services = 17 [default = false];
optional bool py_generic_services = 18 [default = false];
optional bool php_generic_services = 42 [default = false];
// Is this file deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for everything in the file, or it will be completely ignored; in the very
// least, this is a formalization for deprecating files.
optional bool deprecated = 23 [default = false];
// Enables the use of arenas for the proto messages in this file. This applies
// only to generated classes for C++.
optional bool cc_enable_arenas = 31 [default = true];
// Sets the objective c class prefix which is prepended to all objective c
// generated classes from this .proto. There is no default.
optional string objc_class_prefix = 36;
// Namespace for generated classes; defaults to the package.
optional string csharp_namespace = 37;
// By default Swift generators will take the proto package and CamelCase it
// replacing '.' with underscore and use that to prefix the types/symbols
// defined. When this options is provided, they will use this value instead
// to prefix the types/symbols defined.
optional string swift_prefix = 39;
// Sets the php class prefix which is prepended to all php generated classes
// from this .proto. Default is empty.
optional string php_class_prefix = 40;
// Use this option to change the namespace of php generated classes. Default
// is empty. When this option is empty, the package name will be used for
// determining the namespace.
optional string php_namespace = 41;
// Use this option to change the namespace of php generated metadata classes.
// Default is empty. When this option is empty, the proto file name will be
// used for determining the namespace.
optional string php_metadata_namespace = 44;
// Use this option to change the package of ruby generated classes. Default
// is empty. When this option is not set, the package name will be used for
// determining the ruby package.
optional string ruby_package = 45;
// The parser stores options it doesn't recognize here.
// See the documentation for the "Options" section above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message.
// See the documentation for the "Options" section above.
extensions 1000 to max;
reserved 38;
}
message MessageOptions {
// Set true to use the old proto1 MessageSet wire format for extensions.
// This is provided for backwards-compatibility with the MessageSet wire
// format. You should not use this for any other reason: It's less
// efficient, has fewer features, and is more complicated.
//
// The message must be defined exactly as follows:
// message Foo {
// option message_set_wire_format = true;
// extensions 4 to max;
// }
// Note that the message cannot have any defined fields; MessageSets only
// have extensions.
//
// All extensions of your type must be singular messages; e.g. they cannot
// be int32s, enums, or repeated messages.
//
// Because this is an option, the above two restrictions are not enforced by
// the protocol compiler.
optional bool message_set_wire_format = 1 [default = false];
// Disables the generation of the standard "descriptor()" accessor, which can
// conflict with a field of the same name. This is meant to make migration
// from proto1 easier; new code should avoid fields named "descriptor".
optional bool no_standard_descriptor_accessor = 2 [default = false];
// Is this message deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for the message, or it will be completely ignored; in the very least,
// this is a formalization for deprecating messages.
optional bool deprecated = 3 [default = false];
// Whether the message is an automatically generated map entry type for the
// maps field.
//
// For maps fields:
// map<KeyType, ValueType> map_field = 1;
// The parsed descriptor looks like:
// message MapFieldEntry {
// option map_entry = true;
// optional KeyType key = 1;
// optional ValueType value = 2;
// }
// repeated MapFieldEntry map_field = 1;
//
// Implementations may choose not to generate the map_entry=true message, but
// use a native map in the target language to hold the keys and values.
// The reflection APIs in such implementations still need to work as
// if the field is a repeated message field.
//
// NOTE: Do not set the option in .proto files. Always use the maps syntax
// instead. The option should only be implicitly set by the proto compiler
// parser.
optional bool map_entry = 7;
reserved 8; // javalite_serializable
reserved 9; // javanano_as_lite
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
message FieldOptions {
// The ctype option instructs the C++ code generator to use a different
// representation of the field than it normally would. See the specific
// options below. This option is not yet implemented in the open source
// release -- sorry, we'll try to include it in a future version!
optional CType ctype = 1 [default = STRING];
enum CType {
// Default mode.
STRING = 0;
CORD = 1;
STRING_PIECE = 2;
}
// The packed option can be enabled for repeated primitive fields to enable
// a more efficient representation on the wire. Rather than repeatedly
// writing the tag and type for each element, the entire array is encoded as
// a single length-delimited blob. In proto3, only explicit setting it to
// false will avoid using packed encoding.
optional bool packed = 2;
// The jstype option determines the JavaScript type used for values of the
// field. The option is permitted only for 64 bit integral and fixed types
// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
// is represented as JavaScript string, which avoids loss of precision that
// can happen when a large value is converted to a floating point JavaScript.
// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
// use the JavaScript "number" type. The behavior of the default option
// JS_NORMAL is implementation dependent.
//
// This option is an enum to permit additional types to be added, e.g.
// goog.math.Integer.
optional JSType jstype = 6 [default = JS_NORMAL];
enum JSType {
// Use the default type.
JS_NORMAL = 0;
// Use JavaScript strings.
JS_STRING = 1;
// Use JavaScript numbers.
JS_NUMBER = 2;
}
// Should this field be parsed lazily? Lazy applies only to message-type
// fields. It means that when the outer message is initially parsed, the
// inner message's contents will not be parsed but instead stored in encoded
// form. The inner message will actually be parsed when it is first accessed.
//
// This is only a hint. Implementations are free to choose whether to use
// eager or lazy parsing regardless of the value of this option. However,
// setting this option true suggests that the protocol author believes that
// using lazy parsing on this field is worth the additional bookkeeping
// overhead typically needed to implement it.
//
// This option does not affect the public interface of any generated code;
// all method signatures remain the same. Furthermore, thread-safety of the
// interface is not affected by this option; const methods remain safe to
// call from multiple threads concurrently, while non-const methods continue
// to require exclusive access.
//
//
// Note that implementations may choose not to check required fields within
// a lazy sub-message. That is, calling IsInitialized() on the outer message
// may return true even if the inner message has missing required fields.
// This is necessary because otherwise the inner message would have to be
// parsed in order to perform the check, defeating the purpose of lazy
// parsing. An implementation which chooses not to check required fields
// must be consistent about it. That is, for any particular sub-message, the
// implementation must either *always* check its required fields, or *never*
// check its required fields, regardless of whether or not the message has
// been parsed.
optional bool lazy = 5 [default = false];
// Is this field deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for accessors, or it will be completely ignored; in the very least, this
// is a formalization for deprecating fields.
optional bool deprecated = 3 [default = false];
// For Google-internal migration only. Do not use.
optional bool weak = 10 [default = false];
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
reserved 4; // removed jtype
}
message OneofOptions {
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
message EnumOptions {
// Set this option to true to allow mapping different tag names to the same
// value.
optional bool allow_alias = 2;
// Is this enum deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for the enum, or it will be completely ignored; in the very least, this
// is a formalization for deprecating enums.
optional bool deprecated = 3 [default = false];
reserved 5; // javanano_as_lite
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
message EnumValueOptions {
// Is this enum value deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for the enum value, or it will be completely ignored; in the very least,
// this is a formalization for deprecating enum values.
optional bool deprecated = 1 [default = false];
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
message ServiceOptions {
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
// framework. We apologize for hoarding these numbers to ourselves, but
// we were already using them long before we decided to release Protocol
// Buffers.
// Is this service deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for the service, or it will be completely ignored; in the very least,
// this is a formalization for deprecating services.
optional bool deprecated = 33 [default = false];
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
message MethodOptions {
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
// framework. We apologize for hoarding these numbers to ourselves, but
// we were already using them long before we decided to release Protocol
// Buffers.
// Is this method deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for the method, or it will be completely ignored; in the very least,
// this is a formalization for deprecating methods.
optional bool deprecated = 33 [default = false];
// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
// or neither? HTTP based RPC implementation may choose GET verb for safe
// methods, and PUT verb for idempotent methods instead of the default POST.
enum IdempotencyLevel {
IDEMPOTENCY_UNKNOWN = 0;
NO_SIDE_EFFECTS = 1; // implies idempotent
IDEMPOTENT = 2; // idempotent, but may have side effects
}
optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
// A message representing a option the parser does not recognize. This only
// appears in options protos created by the compiler::Parser class.
// DescriptorPool resolves these when building Descriptor objects. Therefore,
// options protos in descriptor objects (e.g. returned by Descriptor::options(),
// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
// in them.
message UninterpretedOption {
// The name of the uninterpreted option. Each string represents a segment in
// a dot-separated name. is_extension is true iff a segment represents an
// extension (denoted with parentheses in options specs in .proto files).
// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
// "foo.(bar.baz).qux".
message NamePart {
required string name_part = 1;
required bool is_extension = 2;
}
repeated NamePart name = 2;
// The value of the uninterpreted option, in whatever type the tokenizer
// identified it as during parsing. Exactly one of these should be set.
optional string identifier_value = 3;
optional uint64 positive_int_value = 4;
optional int64 negative_int_value = 5;
optional double double_value = 6;
optional bytes string_value = 7;
optional string aggregate_value = 8;
}
// ===================================================================
// Optional source code info
// Encapsulates information about the original source file from which a
// FileDescriptorProto was generated.
message SourceCodeInfo {
// A Location identifies a piece of source code in a .proto file which
// corresponds to a particular definition. This information is intended
// to be useful to IDEs, code indexers, documentation generators, and similar
// tools.
//
// For example, say we have a file like:
// message Foo {
// optional string foo = 1;
// }
// Let's look at just the field definition:
// optional string foo = 1;
// ^ ^^ ^^ ^ ^^^
// a bc de f ghi
// We have the following locations:
// span path represents
// [a,i) [ 4, 0, 2, 0 ] The whole field definition.
// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
// [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
// [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
//
// Notes:
// - A location may refer to a repeated field itself (i.e. not to any
// particular index within it). This is used whenever a set of elements are
// logically enclosed in a single code segment. For example, an entire
// extend block (possibly containing multiple extension definitions) will
// have an outer location whose path refers to the "extensions" repeated
// field without an index.
// - Multiple locations may have the same path. This happens when a single
// logical declaration is spread out across multiple places. The most
// obvious example is the "extend" block again -- there may be multiple
// extend blocks in the same scope, each of which will have the same path.
// - A location's span is not always a subset of its parent's span. For
// example, the "extendee" of an extension declaration appears at the
// beginning of the "extend" block and is shared by all extensions within
// the block.
// - Just because a location's span is a subset of some other location's span
// does not mean that it is a descendant. For example, a "group" defines
// both a type and a field in a single declaration. Thus, the locations
// corresponding to the type and field and their components will overlap.
// - Code which tries to interpret locations should probably be designed to
// ignore those that it doesn't understand, as more types of locations could
// be recorded in the future.
repeated Location location = 1;
message Location {
// Identifies which part of the FileDescriptorProto was defined at this
// location.
//
// Each element is a field number or an index. They form a path from
// the root FileDescriptorProto to the place where the definition. For
// example, this path:
// [ 4, 3, 2, 7, 1 ]
// refers to:
// file.message_type(3) // 4, 3
// .field(7) // 2, 7
// .name() // 1
// This is because FileDescriptorProto.message_type has field number 4:
// repeated DescriptorProto message_type = 4;
// and DescriptorProto.field has field number 2:
// repeated FieldDescriptorProto field = 2;
// and FieldDescriptorProto.name has field number 1:
// optional string name = 1;
//
// Thus, the above path gives the location of a field name. If we removed
// the last element:
// [ 4, 3, 2, 7 ]
// this path refers to the whole field declaration (from the beginning
// of the label to the terminating semicolon).
repeated int32 path = 1 [packed = true];
// Always has exactly three or four elements: start line, start column,
// end line (optional, otherwise assumed same as start line), end column.
// These are packed into a single field for efficiency. Note that line
// and column numbers are zero-based -- typically you will want to add
// 1 to each before displaying to a user.
repeated int32 span = 2 [packed = true];
// If this SourceCodeInfo represents a complete declaration, these are any
// comments appearing before and after the declaration which appear to be
// attached to the declaration.
//
// A series of line comments appearing on consecutive lines, with no other
// tokens appearing on those lines, will be treated as a single comment.
//
// leading_detached_comments will keep paragraphs of comments that appear
// before (but not connected to) the current element. Each paragraph,
// separated by empty lines, will be one comment element in the repeated
// field.
//
// Only the comment content is provided; comment markers (e.g. //) are
// stripped out. For block comments, leading whitespace and an asterisk
// will be stripped from the beginning of each line other than the first.
// Newlines are included in the output.
//
// Examples:
//
// optional int32 foo = 1; // Comment attached to foo.
// // Comment attached to bar.
// optional int32 bar = 2;
//
// optional string baz = 3;
// // Comment attached to baz.
// // Another line attached to baz.
//
// // Comment attached to qux.
// //
// // Another line attached to qux.
// optional double qux = 4;
//
// // Detached comment for corge. This is not leading or trailing comments
// // to qux or corge because there are blank lines separating it from
// // both.
//
// // Detached comment for corge paragraph 2.
//
// optional string corge = 5;
// /* Block comment attached
// * to corge. Leading asterisks
// * will be removed. */
// /* Block comment attached to
// * grault. */
// optional int32 grault = 6;
//
// // ignored detached comments.
optional string leading_comments = 3;
optional string trailing_comments = 4;
repeated string leading_detached_comments = 6;
}
}
// Describes the relationship between generated code and its original source
// file. A GeneratedCodeInfo message is associated with only one generated
// source file, but may contain references to different source .proto files.
message GeneratedCodeInfo {
// An Annotation connects some span of text in generated code to an element
// of its generating .proto file.
repeated Annotation annotation = 1;
message Annotation {
// Identifies the element in the original source .proto file. This field
// is formatted the same as SourceCodeInfo.Location.path.
repeated int32 path = 1 [packed = true];
// Identifies the filesystem path to the original source .proto.
optional string source_file = 2;
// Identifies the starting offset in bytes in the generated code
// that relates to the identified object.
optional int32 begin = 3;
// Identifies the ending offset in bytes in the generated code that
// relates to the identified offset. The end offset should be one past
// the last relevant byte (so the length of the text = end - begin).
optional int32 end = 4;
}
}
@@ -0,0 +1,15 @@
syntax = "proto3";
package vulcanize.auction.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/auction/v1beta1/types.proto";
option go_package = "github.com/tharsis/ethermint/x/auction/types";
// GenesisState defines the genesis state of the auction module
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
repeated Auction auctions = 2 [
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
];
}
+149
View File
@@ -0,0 +1,149 @@
syntax = "proto3";
package vulcanize.auction.v1beta1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos/base/v1beta1/coin.proto";
import "vulcanize/auction/v1beta1/types.proto";
option go_package = "github.com/tharsis/ethermint/x/auction/types";
// AuctionsRequest is the format for querying all the auctions
message AuctionsRequest {
// pagination defines an optional pagination info for the next request
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// AuctionsResponse returns the list of all auctions
message AuctionsResponse {
// List of auctions
Auctions auctions = 1;
// pagination defines an optional pagination info for the next request
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// AuctionRequest is the format for querying a specific auction
message AuctionRequest {
// Auction ID
string id = 1;
}
// AuctionResponse returns the details of the queried auction
message AuctionResponse {
// Auction details
Auction auction = 1;
}
// BidRequest is the format for querying a specific bid in an auction
message BidRequest {
// Auction ID
string auction_id = 1;
// Bidder address
string bidder = 2;
}
// BidResponse returns the details of the queried bid
message BidResponse {
// Bid details
Bid bid = 1;
}
// BidsRequest is the format for querying all bids in an auction
message BidsRequest {
// Auction ID
string auction_id = 1;
}
// BidsResponse returns details of all bids in an auction
message BidsResponse {
// List of bids in the auction
repeated Bid bids = 1;
}
// AuctionsByBidderRequest is the format for querying all auctions containing a bidder address
message AuctionsByBidderRequest {
// Address of the bidder
string bidder_address = 1;
}
// AuctionsByBidderResponse returns all auctions containing a bidder
message AuctionsByBidderResponse {
// List of auctions
Auctions auctions = 1;
}
// AuctionsByOwnerRequest is the format for querying all auctions created by an owner
message AuctionsByOwnerRequest {
// Address of the owner
string owner_address = 1;
}
// AuctionsByOwnerResponse returns all auctions created by an owner
message AuctionsByOwnerResponse {
// List of auctions
Auctions auctions = 1;
}
// QueryParamsRequest is the format to query the parameters of the auction module
message QueryParamsRequest {
}
// QueryParamsResponse returns parameters of the auction module
message QueryParamsResponse {
Params params = 1;
}
// BalanceRequest is the format to fetch all balances
message BalanceRequest {
}
message BalanceResponse {
// Set of all balances within the auction
repeated cosmos.base.v1beta1.Coin balance = 1 [
(gogoproto.nullable) = false
];
}
// Query defines the gRPC querier interface for the auction module
service Query {
// Auctions queries all auctions
rpc Auctions(AuctionsRequest) returns (AuctionsResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/auctions";
}
// GetAuction queries an auction
rpc GetAuction(AuctionRequest) returns (AuctionResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/auctions/{id}";
}
// GetBid queries an auction bid
rpc GetBid(BidRequest) returns (BidResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/bids/{auction_id}/{bidder}";
}
// GetBids queries all auction bids
rpc GetBids(BidsRequest) returns (BidsResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/bids/{auction_id}";
}
// AuctionsByBidder queries auctions by bidder
rpc AuctionsByBidder(AuctionsByBidderRequest) returns (AuctionsByBidderResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/by-bidder/{bidder_address}";
}
// AuctionsByOwner queries auctions by owner
rpc AuctionsByOwner(AuctionsByOwnerRequest) returns (AuctionsByOwnerResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/by-owner/{owner_address}";
}
// QueryParams implements the params query command
rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/params";
}
// Balance queries the auction module account balance
rpc Balance(BalanceRequest) returns (BalanceResponse) {
option (google.api.http).get = "/vulcanize/auction/v1beta1/balance";
}
}
+122
View File
@@ -0,0 +1,122 @@
syntax = "proto3";
package vulcanize.auction.v1beta1;
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "cosmos/base/v1beta1/coin.proto";
import "vulcanize/auction/v1beta1/types.proto";
option go_package = "github.com/tharsis/ethermint/x/auction/types";
// MsgCreateAuction defines a create auction message
message MsgCreateAuction {
option (gogoproto.goproto_getters) = false;
// Duration of the commits phase in seconds
google.protobuf.Duration commits_duration = 1 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\""
];
// Duration of the reveals phase in seconds
google.protobuf.Duration reveals_duration = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\""
];
// Commit fees
cosmos.base.v1beta1.Coin commit_fee = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
];
// Reveal fees
cosmos.base.v1beta1.Coin reveal_fee = 4 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
];
// Minimum acceptable bid amount
cosmos.base.v1beta1.Coin minimum_bid = 5 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
];
// Address of the signer
string signer = 6 [
(gogoproto.moretags) = "json:\"signer\" yaml:\"signer\""
];
}
// MsgCreateAuctionResponse returns the details of the created auction
message MsgCreateAuctionResponse {
option (gogoproto.goproto_getters) = false;
// Auction details
Auction auction = 1 [
(gogoproto.moretags) = "json:\"auction\" yaml:\"auction\""
];
}
// CommitBid defines the message to commit a bid
message MsgCommitBid {
option (gogoproto.goproto_getters) = false;
// Auction ID
string auction_id = 1 [
(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""
];
// Commit Hash
string commit_hash = 2 [
(gogoproto.moretags) = "json:\"commit_hash\" yaml:\"commit_hash\""
];
// Address of the signer
string signer = 3 [
(gogoproto.moretags) = "json:\"signer\" yaml:\"signer\""
];
}
// RevealBid defines the message to reveal a bid
message MsgRevealBid {
option (gogoproto.goproto_getters) = false;
// Auction ID
string auction_id = 1 [
(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""
];
// Commit Hash
string reveal = 2 [
(gogoproto.moretags) = "json:\"reveal\" yaml:\"reveal\""
];
// Address of the signer
string signer = 3 [
(gogoproto.moretags) = "json:\"signer\" yaml:\"signer\""
];
}
// MsgCommitBidResponse returns the state of the auction after the bid creation
message MsgCommitBidResponse {
option (gogoproto.goproto_getters) = false;
// Auction details
Bid bid = 1 [
(gogoproto.moretags) = "json:\"bid\" yaml:\"bid\""
];
}
// MsgRevealBidResponse returns the state of the auction after the bid reveal
message MsgRevealBidResponse {
option (gogoproto.goproto_getters) = false;
// Auction details
Auction auction = 1 [
(gogoproto.moretags) = "json:\"auction\" yaml:\"auction\""
];
}
// Tx defines the gRPC tx interface
service Msg {
// CreateAuction is the command for creating an auction
rpc CreateAuction(MsgCreateAuction) returns (MsgCreateAuctionResponse);
// CommitBid is the command for committing a bid
rpc CommitBid(MsgCommitBid) returns (MsgCommitBidResponse);
//RevealBid is the command for revealing a bid
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse);
}
+135
View File
@@ -0,0 +1,135 @@
syntax = "proto3";
package vulcanize.auction.v1beta1;
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/tharsis/ethermint/x/auction/types";
// Params defines the auction module parameters
message Params {
option (gogoproto.goproto_stringer) = false;
// Duration of the commits phase in seconds
google.protobuf.Duration commits_duration = 1 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\""
];
// Duration of the reveals phase in seconds
google.protobuf.Duration reveals_duration = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\""
];
// Commit fees
cosmos.base.v1beta1.Coin commit_fee = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
];
// Reveal fees
cosmos.base.v1beta1.Coin reveal_fee = 4 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
];
// Minimum acceptable bid amount
cosmos.base.v1beta1.Coin minimum_bid = 5 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
];
}
// Auction represents a sealed-bid on-chain auction
message Auction {
option (gogoproto.goproto_getters) = false;
string id = 1;
string status = 2;
// Address of the creator of the auction
string owner_address = 3;
// Timestamp at which the auction was created
google.protobuf.Timestamp create_time = 4 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""
];
// Timestamp at which the commits phase concluded
google.protobuf.Timestamp commits_end_time = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\""
];
// Timestamp at which the reveals phase concluded
google.protobuf.Timestamp reveals_end_time = 6 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\""
];
// Commit and reveal fees must both be paid when committing a bid
// Reveal fee is returned only if the bid is revealed
cosmos.base.v1beta1.Coin commit_fee = 7 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
];
cosmos.base.v1beta1.Coin reveal_fee = 8 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
];
// Minimum acceptable bid amount for a valid commit
cosmos.base.v1beta1.Coin minimum_bid = 9 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
];
// Address of the winner
string winner_address = 10;
// Winning bid, i.e., the highest bid
cosmos.base.v1beta1.Coin winning_bid = 11 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"winning_bid\" yaml:\"winning_bid\""
];
// Amount the winner pays, i.e. the second highest auction
cosmos.base.v1beta1.Coin winning_price = 12 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\""
];
}
message Auctions {
option (gogoproto.goproto_getters) = false;
repeated Auction auctions = 1 [(gogoproto.nullable) = false];
}
// Bid represents a sealed bid (commit) made during the auction
message Bid {
option (gogoproto.goproto_getters) = false;
string auction_id = 1;
string bidder_address = 2;
string status = 3;
string commit_hash = 4;
google.protobuf.Timestamp commit_time = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commit_time\" yaml:\"commit_time\""
];
cosmos.base.v1beta1.Coin commit_fee = 6 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
];
google.protobuf.Timestamp reveal_time = 7 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveal_time\" yaml:\"reveal_time\""
];
cosmos.base.v1beta1.Coin reveal_fee = 8 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
];
cosmos.base.v1beta1.Coin bid_amount = 9 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"bid_amount\" yaml:\"bid_amount\""
];;
}
+29
View File
@@ -0,0 +1,29 @@
syntax = "proto3";
package vulcanize.bond.v1beta1;
option go_package = "github.com/tharsis/ethermint/x/bond/types";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
// Params defines the bond module parameters
message Params {
// max_bond_amount is maximum amount to bond
cosmos.base.v1beta1.Coin max_bond_amount = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"max_bond_amount\" yaml:\"max_bond_amount\""
];
}
// Bond represents funds deposited by an account for record rent payments.
message Bond {
// id is unique identifier of the bond
string id = 1;
// owner of the bond
string owner = 2;
// balance of the bond
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\""
];
}
@@ -0,0 +1,18 @@
syntax = "proto3";
package vulcanize.bond.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/bond/v1beta1/bond.proto";
option go_package = "github.com/tharsis/ethermint/x/bond/types";
// GenesisState defines the bond module's genesis state.
message GenesisState {
// params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false];
// bonds defines all the bonds
repeated Bond bonds = 2 [
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
];
}
+109
View File
@@ -0,0 +1,109 @@
syntax = "proto3";
package vulcanize.bond.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/bond/v1beta1/bond.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/tharsis/ethermint/x/bond/types";
// Query defines the gRPC querier service for bond module
service Query {
// Params queries bonds module params.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/vulcanize/bond/v1beta1/params";
}
// Bonds queries bonds list.
rpc Bonds(QueryGetBondsRequest) returns (QueryGetBondsResponse) {
option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds";
}
// GetBondById
rpc GetBondById(QueryGetBondByIdRequest) returns (QueryGetBondByIdResponse){
option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds/{id}";
}
// Get Bonds List by Owner
rpc GetBondsByOwner(QueryGetBondsByOwnerRequest) returns (QueryGetBondsByOwnerResponse){
option (google.api.http).get = "/vulcanize/bond/v1beta1/by-owner/{owner}";
}
// Get Bonds module balance
rpc GetBondsModuleBalance(QueryGetBondModuleBalanceRequest) returns (QueryGetBondModuleBalanceResponse){
option (google.api.http).get = "/vulcanize/bond/v1beta1/balance";
}
}
// QueryParamsRequest is request for query the bond module params
message QueryParamsRequest{
}
// QueryParamsResponse returns response type of bond module params
message QueryParamsResponse{
Params params = 1 [
(gogoproto.moretags) = "json:\"params\" yaml:\"params\""
];
}
// QueryGetBondById queries a bond by bond-id.
message QueryGetBondsRequest{
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetBondsResponse is response type for get the bonds by bond-id
message QueryGetBondsResponse{
repeated Bond bonds = 1 [
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryGetBondById
message QueryGetBondByIdRequest{
string id = 1 [
(gogoproto.moretags) = "json:\"id\" yaml:\"id\""
];
}
// QueryGetBondByIdResponse returns QueryGetBondById query response
message QueryGetBondByIdResponse{
Bond bond = 1 [
(gogoproto.moretags) = "json:\"bond\" yaml:\"bond\""
];
}
// QueryGetBondsByOwnerRequest is request type for Query/GetBondsByOwner RPC Method
message QueryGetBondsByOwnerRequest{
string owner = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryGetBondsByOwnerResponse is response type for Query/GetBondsByOwner RPC Method
message QueryGetBondsByOwnerResponse {
repeated Bond bonds = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryGetBondModuleBalanceRequest is request type for bond module balance rpc method
message QueryGetBondModuleBalanceRequest{
}
// QueryGetBondModuleBalanceResponse is the response type for bond module balance rpc method
message QueryGetBondModuleBalanceResponse{
repeated cosmos.base.v1beta1.Coin balance = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
];
}
+77
View File
@@ -0,0 +1,77 @@
syntax = "proto3";
package vulcanize.bond.v1beta1;
option go_package = "github.com/tharsis/ethermint/x/bond/types";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
// Msg defines the bond Msg service.
service Msg {
// CreateBond defines a method for creating a new bond.
rpc CreateBond(MsgCreateBond) returns (MsgCreateBondResponse);
// RefillBond defines a method for refilling amount for bond.
rpc RefillBond(MsgRefillBond) returns (MsgRefillBondResponse);
// WithdrawBond defines a method for withdrawing amount from bond.
rpc WithdrawBond(MsgWithdrawBond) returns (MsgWithdrawBondResponse);
// CancelBond defines a method for cancelling a bond.
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse);
}
// MsgCreateBond defines a SDK message for creating a new bond.
message MsgCreateBond{
string signer = 1;
repeated cosmos.base.v1beta1.Coin coins = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
];
}
// MsgCreateBondResponse defines the Msg/CreateBond response type.
message MsgCreateBondResponse{
string id = 1;
}
// MsgRefillBond defines a SDK message for refill the amount for bond.
message MsgRefillBond{
string id = 1;
string signer = 2;
repeated cosmos.base.v1beta1.Coin coins = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
];
}
// MsgRefillBondResponse defines the Msg/RefillBond response type.
message MsgRefillBondResponse{
}
// MsgWithdrawBond defines a SDK message for withdrawing amount from bond.
message MsgWithdrawBond {
string id = 1;
string signer = 2;
repeated cosmos.base.v1beta1.Coin coins = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
];
}
// MsgWithdrawBondResponse defines the Msg/WithdrawBond response type.
message MsgWithdrawBondResponse{
}
// MsgCancelBond defines a SDK message for the cancel the bond.
message MsgCancelBond{
string id = 1;
string signer = 2;
}
// MsgCancelBondResponse defines the Msg/CancelBond response type.
message MsgCancelBondResponse{
}
@@ -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{
}
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
# NOTE: protoc is required
I=$(pwd)/proto
DEST_TS=$(pwd)/src/proto/
mkdir -p $DEST_TS
protoc \
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
--ts_out=$DEST_TS \
--proto_path=$I \
$(find $(pwd)/proto/vulcanize -iname "*.proto")
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
echo $PWD
for file in $(find src/proto -type f)
do
line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':')
if [[ $line -gt 0 ]];
then
echo "Processing file... $file"
sed -i "${line}d" ${file}
functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':')
sed -i "${functions},\$d" ${file}
echo '}' >> $file
fi
sed -i '1s#^#/* eslint-disable */\n#' $file
sed -i '1s#^#// @ts-nocheck\n#' $file
done

Some files were not shown because too many files have changed in this diff Show More