@dydxprotocol/v4-proto
Advanced tools
Comparing version 8.0.0 to 8.0.1-rc.0
{ | ||
"name": "@dydxprotocol/v4-proto", | ||
"version": "8.0.0", | ||
"version": "8.0.1-rc.0", | ||
"access": "public", | ||
@@ -5,0 +5,0 @@ "description": "Protos for dYdX v4 protocol", |
import { LCDClient } from "@osmonauts/lcd"; | ||
import { QueryParamsRequest, QueryParamsResponseSDKType, GetAuthenticatorRequest, GetAuthenticatorResponseSDKType, GetAuthenticatorsRequest, GetAuthenticatorsResponseSDKType } from "./query"; | ||
import { QueryParamsRequest, QueryParamsResponseSDKType, GetAuthenticatorRequest, GetAuthenticatorResponseSDKType, GetAuthenticatorsRequest, GetAuthenticatorsResponseSDKType, AccountStateRequest, AccountStateResponseSDKType } from "./query"; | ||
export class LCDQueryClient { | ||
@@ -15,2 +15,3 @@ req: LCDClient; | ||
this.getAuthenticators = this.getAuthenticators.bind(this); | ||
this.accountState = this.accountState.bind(this); | ||
} | ||
@@ -38,3 +39,10 @@ /* Parameters queries the parameters of the module. */ | ||
} | ||
/* Queries for an account state (timestamp nonce). */ | ||
async accountState(params: AccountStateRequest): Promise<AccountStateResponseSDKType> { | ||
const endpoint = `dydxprotocol/accountplus/account_state/${params.address}`; | ||
return await this.req.get<AccountStateResponseSDKType>(endpoint); | ||
} | ||
} |
import { Rpc } from "../../helpers"; | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; | ||
import { QueryParamsRequest, QueryParamsResponse, GetAuthenticatorRequest, GetAuthenticatorResponse, GetAuthenticatorsRequest, GetAuthenticatorsResponse } from "./query"; | ||
import { QueryParamsRequest, QueryParamsResponse, GetAuthenticatorRequest, GetAuthenticatorResponse, GetAuthenticatorsRequest, GetAuthenticatorsResponse, AccountStateRequest, AccountStateResponse } from "./query"; | ||
/** Query defines the gRPC querier service. */ | ||
@@ -16,2 +16,5 @@ | ||
getAuthenticators(request: GetAuthenticatorsRequest): Promise<GetAuthenticatorsResponse>; | ||
/** Queries for an account state (timestamp nonce). */ | ||
accountState(request: AccountStateRequest): Promise<AccountStateResponse>; | ||
} | ||
@@ -26,2 +29,3 @@ export class QueryClientImpl implements Query { | ||
this.getAuthenticators = this.getAuthenticators.bind(this); | ||
this.accountState = this.accountState.bind(this); | ||
} | ||
@@ -47,2 +51,8 @@ | ||
accountState(request: AccountStateRequest): Promise<AccountStateResponse> { | ||
const data = AccountStateRequest.encode(request).finish(); | ||
const promise = this.rpc.request("dydxprotocol.accountplus.Query", "AccountState", data); | ||
return promise.then(data => AccountStateResponse.decode(new _m0.Reader(data))); | ||
} | ||
} | ||
@@ -63,2 +73,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { | ||
return queryService.getAuthenticators(request); | ||
}, | ||
accountState(request: AccountStateRequest): Promise<AccountStateResponse> { | ||
return queryService.accountState(request); | ||
} | ||
@@ -65,0 +79,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { AccountState, AccountStateSDKType } from "./accountplus"; | ||
import { Params, ParamsSDKType } from "./params"; | ||
@@ -5,2 +6,33 @@ import { AccountAuthenticator, AccountAuthenticatorSDKType } from "./models"; | ||
import { DeepPartial, Long } from "../../helpers"; | ||
/** AccountStateRequest is request type for the Query/AccountState RPC method. */ | ||
export interface AccountStateRequest { | ||
/** AccountStateRequest is request type for the Query/AccountState RPC method. */ | ||
address: string; | ||
} | ||
/** AccountStateRequest is request type for the Query/AccountState RPC method. */ | ||
export interface AccountStateRequestSDKType { | ||
address: string; | ||
} | ||
/** | ||
* AccountStateResponse is response type for the Query/GetAccountState RPC | ||
* method. | ||
*/ | ||
export interface AccountStateResponse { | ||
/** | ||
* AccountStateResponse is response type for the Query/GetAccountState RPC | ||
* method. | ||
*/ | ||
accountState?: AccountState; | ||
} | ||
/** | ||
* AccountStateResponse is response type for the Query/GetAccountState RPC | ||
* method. | ||
*/ | ||
export interface AccountStateResponseSDKType { | ||
account_state?: AccountStateSDKType; | ||
} | ||
/** QueryParamsRequest is request type for the Query/Params RPC method. */ | ||
@@ -67,2 +99,92 @@ | ||
function createBaseAccountStateRequest(): AccountStateRequest { | ||
return { | ||
address: "" | ||
}; | ||
} | ||
export const AccountStateRequest = { | ||
encode(message: AccountStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.address !== "") { | ||
writer.uint32(10).string(message.address); | ||
} | ||
return writer; | ||
}, | ||
decode(input: _m0.Reader | Uint8Array, length?: number): AccountStateRequest { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseAccountStateRequest(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.address = reader.string(); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromPartial(object: DeepPartial<AccountStateRequest>): AccountStateRequest { | ||
const message = createBaseAccountStateRequest(); | ||
message.address = object.address ?? ""; | ||
return message; | ||
} | ||
}; | ||
function createBaseAccountStateResponse(): AccountStateResponse { | ||
return { | ||
accountState: undefined | ||
}; | ||
} | ||
export const AccountStateResponse = { | ||
encode(message: AccountStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.accountState !== undefined) { | ||
AccountState.encode(message.accountState, writer.uint32(10).fork()).ldelim(); | ||
} | ||
return writer; | ||
}, | ||
decode(input: _m0.Reader | Uint8Array, length?: number): AccountStateResponse { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseAccountStateResponse(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.accountState = AccountState.decode(reader, reader.uint32()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromPartial(object: DeepPartial<AccountStateResponse>): AccountStateResponse { | ||
const message = createBaseAccountStateResponse(); | ||
message.accountState = object.accountState !== undefined && object.accountState !== null ? AccountState.fromPartial(object.accountState) : undefined; | ||
return message; | ||
} | ||
}; | ||
function createBaseQueryParamsRequest(): QueryParamsRequest { | ||
@@ -69,0 +191,0 @@ return {}; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3459964
92359
0
1