2379 lines
96 KiB
TypeScript
2379 lines
96 KiB
TypeScript
/**
|
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
|
* compiler version: 0.0.0
|
|
* source: wallet.proto
|
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
|
import * as pb_1 from "google-protobuf";
|
|
import * as grpc_1 from "@grpc/grpc-js";
|
|
export namespace wallet {
|
|
export class GetWalletRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
is_total_today_in?: boolean;
|
|
is_total_today_out?: boolean;
|
|
is_total_month_in?: boolean;
|
|
is_total_month_out?: boolean;
|
|
is_total_all_in?: boolean;
|
|
is_total_all_out?: boolean;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("is_total_today_in" in data && data.is_total_today_in != undefined) {
|
|
this.is_total_today_in = data.is_total_today_in;
|
|
}
|
|
if ("is_total_today_out" in data && data.is_total_today_out != undefined) {
|
|
this.is_total_today_out = data.is_total_today_out;
|
|
}
|
|
if ("is_total_month_in" in data && data.is_total_month_in != undefined) {
|
|
this.is_total_month_in = data.is_total_month_in;
|
|
}
|
|
if ("is_total_month_out" in data && data.is_total_month_out != undefined) {
|
|
this.is_total_month_out = data.is_total_month_out;
|
|
}
|
|
if ("is_total_all_in" in data && data.is_total_all_in != undefined) {
|
|
this.is_total_all_in = data.is_total_all_in;
|
|
}
|
|
if ("is_total_all_out" in data && data.is_total_all_out != undefined) {
|
|
this.is_total_all_out = data.is_total_all_out;
|
|
}
|
|
}
|
|
}
|
|
get is_total_today_in() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean;
|
|
}
|
|
set is_total_today_in(value: boolean) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get is_total_today_out() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
|
|
}
|
|
set is_total_today_out(value: boolean) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get is_total_month_in() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
|
|
}
|
|
set is_total_month_in(value: boolean) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get is_total_month_out() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
|
}
|
|
set is_total_month_out(value: boolean) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
get is_total_all_in() {
|
|
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
|
|
}
|
|
set is_total_all_in(value: boolean) {
|
|
pb_1.Message.setField(this, 5, value);
|
|
}
|
|
get is_total_all_out() {
|
|
return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
|
|
}
|
|
set is_total_all_out(value: boolean) {
|
|
pb_1.Message.setField(this, 6, value);
|
|
}
|
|
static fromObject(data: {
|
|
is_total_today_in?: boolean;
|
|
is_total_today_out?: boolean;
|
|
is_total_month_in?: boolean;
|
|
is_total_month_out?: boolean;
|
|
is_total_all_in?: boolean;
|
|
is_total_all_out?: boolean;
|
|
}): GetWalletRequest {
|
|
const message = new GetWalletRequest({});
|
|
if (data.is_total_today_in != null) {
|
|
message.is_total_today_in = data.is_total_today_in;
|
|
}
|
|
if (data.is_total_today_out != null) {
|
|
message.is_total_today_out = data.is_total_today_out;
|
|
}
|
|
if (data.is_total_month_in != null) {
|
|
message.is_total_month_in = data.is_total_month_in;
|
|
}
|
|
if (data.is_total_month_out != null) {
|
|
message.is_total_month_out = data.is_total_month_out;
|
|
}
|
|
if (data.is_total_all_in != null) {
|
|
message.is_total_all_in = data.is_total_all_in;
|
|
}
|
|
if (data.is_total_all_out != null) {
|
|
message.is_total_all_out = data.is_total_all_out;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
is_total_today_in?: boolean;
|
|
is_total_today_out?: boolean;
|
|
is_total_month_in?: boolean;
|
|
is_total_month_out?: boolean;
|
|
is_total_all_in?: boolean;
|
|
is_total_all_out?: boolean;
|
|
} = {};
|
|
if (this.is_total_today_in != null) {
|
|
data.is_total_today_in = this.is_total_today_in;
|
|
}
|
|
if (this.is_total_today_out != null) {
|
|
data.is_total_today_out = this.is_total_today_out;
|
|
}
|
|
if (this.is_total_month_in != null) {
|
|
data.is_total_month_in = this.is_total_month_in;
|
|
}
|
|
if (this.is_total_month_out != null) {
|
|
data.is_total_month_out = this.is_total_month_out;
|
|
}
|
|
if (this.is_total_all_in != null) {
|
|
data.is_total_all_in = this.is_total_all_in;
|
|
}
|
|
if (this.is_total_all_out != null) {
|
|
data.is_total_all_out = this.is_total_all_out;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.is_total_today_in != false)
|
|
writer.writeBool(1, this.is_total_today_in);
|
|
if (this.is_total_today_out != false)
|
|
writer.writeBool(2, this.is_total_today_out);
|
|
if (this.is_total_month_in != false)
|
|
writer.writeBool(3, this.is_total_month_in);
|
|
if (this.is_total_month_out != false)
|
|
writer.writeBool(4, this.is_total_month_out);
|
|
if (this.is_total_all_in != false)
|
|
writer.writeBool(5, this.is_total_all_in);
|
|
if (this.is_total_all_out != false)
|
|
writer.writeBool(6, this.is_total_all_out);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetWalletRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetWalletRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.is_total_today_in = reader.readBool();
|
|
break;
|
|
case 2:
|
|
message.is_total_today_out = reader.readBool();
|
|
break;
|
|
case 3:
|
|
message.is_total_month_in = reader.readBool();
|
|
break;
|
|
case 4:
|
|
message.is_total_month_out = reader.readBool();
|
|
break;
|
|
case 5:
|
|
message.is_total_all_in = reader.readBool();
|
|
break;
|
|
case 6:
|
|
message.is_total_all_out = reader.readBool();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): GetWalletRequest {
|
|
return GetWalletRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class GetWalletReply extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
passport_identity?: string;
|
|
wallet_identity?: string;
|
|
balance?: number;
|
|
withdrawal_balance?: number;
|
|
status?: number;
|
|
alipay_id?: string;
|
|
alipay_name?: string;
|
|
wxpay_id?: string;
|
|
wxpay_name?: string;
|
|
total?: Map<string, number>;
|
|
created?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("passport_identity" in data && data.passport_identity != undefined) {
|
|
this.passport_identity = data.passport_identity;
|
|
}
|
|
if ("wallet_identity" in data && data.wallet_identity != undefined) {
|
|
this.wallet_identity = data.wallet_identity;
|
|
}
|
|
if ("balance" in data && data.balance != undefined) {
|
|
this.balance = data.balance;
|
|
}
|
|
if ("withdrawal_balance" in data && data.withdrawal_balance != undefined) {
|
|
this.withdrawal_balance = data.withdrawal_balance;
|
|
}
|
|
if ("status" in data && data.status != undefined) {
|
|
this.status = data.status;
|
|
}
|
|
if ("alipay_id" in data && data.alipay_id != undefined) {
|
|
this.alipay_id = data.alipay_id;
|
|
}
|
|
if ("alipay_name" in data && data.alipay_name != undefined) {
|
|
this.alipay_name = data.alipay_name;
|
|
}
|
|
if ("wxpay_id" in data && data.wxpay_id != undefined) {
|
|
this.wxpay_id = data.wxpay_id;
|
|
}
|
|
if ("wxpay_name" in data && data.wxpay_name != undefined) {
|
|
this.wxpay_name = data.wxpay_name;
|
|
}
|
|
if ("total" in data && data.total != undefined) {
|
|
this.total = data.total;
|
|
}
|
|
if ("created" in data && data.created != undefined) {
|
|
this.created = data.created;
|
|
}
|
|
}
|
|
if (!this.total)
|
|
this.total = new Map();
|
|
}
|
|
get passport_identity() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
|
}
|
|
set passport_identity(value: string) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get wallet_identity() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set wallet_identity(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get balance() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
|
|
}
|
|
set balance(value: number) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get withdrawal_balance() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
|
|
}
|
|
set withdrawal_balance(value: number) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
get status() {
|
|
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
|
|
}
|
|
set status(value: number) {
|
|
pb_1.Message.setField(this, 5, value);
|
|
}
|
|
get alipay_id() {
|
|
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
|
}
|
|
set alipay_id(value: string) {
|
|
pb_1.Message.setField(this, 6, value);
|
|
}
|
|
get alipay_name() {
|
|
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
|
|
}
|
|
set alipay_name(value: string) {
|
|
pb_1.Message.setField(this, 7, value);
|
|
}
|
|
get wxpay_id() {
|
|
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
|
|
}
|
|
set wxpay_id(value: string) {
|
|
pb_1.Message.setField(this, 8, value);
|
|
}
|
|
get wxpay_name() {
|
|
return pb_1.Message.getFieldWithDefault(this, 9, "") as string;
|
|
}
|
|
set wxpay_name(value: string) {
|
|
pb_1.Message.setField(this, 9, value);
|
|
}
|
|
get total() {
|
|
return pb_1.Message.getField(this, 10) as any as Map<string, number>;
|
|
}
|
|
set total(value: Map<string, number>) {
|
|
pb_1.Message.setField(this, 10, value as any);
|
|
}
|
|
get created() {
|
|
return pb_1.Message.getFieldWithDefault(this, 11, "") as string;
|
|
}
|
|
set created(value: string) {
|
|
pb_1.Message.setField(this, 11, value);
|
|
}
|
|
static fromObject(data: {
|
|
passport_identity?: string;
|
|
wallet_identity?: string;
|
|
balance?: number;
|
|
withdrawal_balance?: number;
|
|
status?: number;
|
|
alipay_id?: string;
|
|
alipay_name?: string;
|
|
wxpay_id?: string;
|
|
wxpay_name?: string;
|
|
total?: {
|
|
[key: string]: number;
|
|
};
|
|
created?: string;
|
|
}): GetWalletReply {
|
|
const message = new GetWalletReply({});
|
|
if (data.passport_identity != null) {
|
|
message.passport_identity = data.passport_identity;
|
|
}
|
|
if (data.wallet_identity != null) {
|
|
message.wallet_identity = data.wallet_identity;
|
|
}
|
|
if (data.balance != null) {
|
|
message.balance = data.balance;
|
|
}
|
|
if (data.withdrawal_balance != null) {
|
|
message.withdrawal_balance = data.withdrawal_balance;
|
|
}
|
|
if (data.status != null) {
|
|
message.status = data.status;
|
|
}
|
|
if (data.alipay_id != null) {
|
|
message.alipay_id = data.alipay_id;
|
|
}
|
|
if (data.alipay_name != null) {
|
|
message.alipay_name = data.alipay_name;
|
|
}
|
|
if (data.wxpay_id != null) {
|
|
message.wxpay_id = data.wxpay_id;
|
|
}
|
|
if (data.wxpay_name != null) {
|
|
message.wxpay_name = data.wxpay_name;
|
|
}
|
|
if (typeof data.total == "object") {
|
|
message.total = new Map(Object.entries(data.total));
|
|
}
|
|
if (data.created != null) {
|
|
message.created = data.created;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
passport_identity?: string;
|
|
wallet_identity?: string;
|
|
balance?: number;
|
|
withdrawal_balance?: number;
|
|
status?: number;
|
|
alipay_id?: string;
|
|
alipay_name?: string;
|
|
wxpay_id?: string;
|
|
wxpay_name?: string;
|
|
total?: {
|
|
[key: string]: number;
|
|
};
|
|
created?: string;
|
|
} = {};
|
|
if (this.passport_identity != null) {
|
|
data.passport_identity = this.passport_identity;
|
|
}
|
|
if (this.wallet_identity != null) {
|
|
data.wallet_identity = this.wallet_identity;
|
|
}
|
|
if (this.balance != null) {
|
|
data.balance = this.balance;
|
|
}
|
|
if (this.withdrawal_balance != null) {
|
|
data.withdrawal_balance = this.withdrawal_balance;
|
|
}
|
|
if (this.status != null) {
|
|
data.status = this.status;
|
|
}
|
|
if (this.alipay_id != null) {
|
|
data.alipay_id = this.alipay_id;
|
|
}
|
|
if (this.alipay_name != null) {
|
|
data.alipay_name = this.alipay_name;
|
|
}
|
|
if (this.wxpay_id != null) {
|
|
data.wxpay_id = this.wxpay_id;
|
|
}
|
|
if (this.wxpay_name != null) {
|
|
data.wxpay_name = this.wxpay_name;
|
|
}
|
|
if (this.total != null) {
|
|
data.total = (Object.fromEntries)(this.total);
|
|
}
|
|
if (this.created != null) {
|
|
data.created = this.created;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.passport_identity.length)
|
|
writer.writeString(1, this.passport_identity);
|
|
if (this.wallet_identity.length)
|
|
writer.writeString(2, this.wallet_identity);
|
|
if (this.balance != 0)
|
|
writer.writeInt64(3, this.balance);
|
|
if (this.withdrawal_balance != 0)
|
|
writer.writeInt64(4, this.withdrawal_balance);
|
|
if (this.status != 0)
|
|
writer.writeInt32(5, this.status);
|
|
if (this.alipay_id.length)
|
|
writer.writeString(6, this.alipay_id);
|
|
if (this.alipay_name.length)
|
|
writer.writeString(7, this.alipay_name);
|
|
if (this.wxpay_id.length)
|
|
writer.writeString(8, this.wxpay_id);
|
|
if (this.wxpay_name.length)
|
|
writer.writeString(9, this.wxpay_name);
|
|
for (const [key, value] of this.total) {
|
|
writer.writeMessage(10, this.total, () => {
|
|
writer.writeString(1, key);
|
|
writer.writeInt64(2, value);
|
|
});
|
|
}
|
|
if (this.created.length)
|
|
writer.writeString(11, this.created);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetWalletReply {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetWalletReply();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.passport_identity = reader.readString();
|
|
break;
|
|
case 2:
|
|
message.wallet_identity = reader.readString();
|
|
break;
|
|
case 3:
|
|
message.balance = reader.readInt64();
|
|
break;
|
|
case 4:
|
|
message.withdrawal_balance = reader.readInt64();
|
|
break;
|
|
case 5:
|
|
message.status = reader.readInt32();
|
|
break;
|
|
case 6:
|
|
message.alipay_id = reader.readString();
|
|
break;
|
|
case 7:
|
|
message.alipay_name = reader.readString();
|
|
break;
|
|
case 8:
|
|
message.wxpay_id = reader.readString();
|
|
break;
|
|
case 9:
|
|
message.wxpay_name = reader.readString();
|
|
break;
|
|
case 10:
|
|
reader.readMessage(message, () => pb_1.Map.deserializeBinary(message.total as any, reader, reader.readString, reader.readInt64));
|
|
break;
|
|
case 11:
|
|
message.created = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): GetWalletReply {
|
|
return GetWalletReply.deserialize(bytes);
|
|
}
|
|
}
|
|
export class TransactionsRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
trans_type?: number;
|
|
trade_type?: number;
|
|
start?: string;
|
|
end?: string;
|
|
page?: number;
|
|
page_size?: number;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("trans_type" in data && data.trans_type != undefined) {
|
|
this.trans_type = data.trans_type;
|
|
}
|
|
if ("trade_type" in data && data.trade_type != undefined) {
|
|
this.trade_type = data.trade_type;
|
|
}
|
|
if ("start" in data && data.start != undefined) {
|
|
this.start = data.start;
|
|
}
|
|
if ("end" in data && data.end != undefined) {
|
|
this.end = data.end;
|
|
}
|
|
if ("page" in data && data.page != undefined) {
|
|
this.page = data.page;
|
|
}
|
|
if ("page_size" in data && data.page_size != undefined) {
|
|
this.page_size = data.page_size;
|
|
}
|
|
}
|
|
}
|
|
get trans_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set trans_type(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get trade_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
|
}
|
|
set trade_type(value: number) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get start() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
}
|
|
set start(value: string) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get end() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
|
}
|
|
set end(value: string) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
get page() {
|
|
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
|
|
}
|
|
set page(value: number) {
|
|
pb_1.Message.setField(this, 5, value);
|
|
}
|
|
get page_size() {
|
|
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
|
|
}
|
|
set page_size(value: number) {
|
|
pb_1.Message.setField(this, 6, value);
|
|
}
|
|
static fromObject(data: {
|
|
trans_type?: number;
|
|
trade_type?: number;
|
|
start?: string;
|
|
end?: string;
|
|
page?: number;
|
|
page_size?: number;
|
|
}): TransactionsRequest {
|
|
const message = new TransactionsRequest({});
|
|
if (data.trans_type != null) {
|
|
message.trans_type = data.trans_type;
|
|
}
|
|
if (data.trade_type != null) {
|
|
message.trade_type = data.trade_type;
|
|
}
|
|
if (data.start != null) {
|
|
message.start = data.start;
|
|
}
|
|
if (data.end != null) {
|
|
message.end = data.end;
|
|
}
|
|
if (data.page != null) {
|
|
message.page = data.page;
|
|
}
|
|
if (data.page_size != null) {
|
|
message.page_size = data.page_size;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
trans_type?: number;
|
|
trade_type?: number;
|
|
start?: string;
|
|
end?: string;
|
|
page?: number;
|
|
page_size?: number;
|
|
} = {};
|
|
if (this.trans_type != null) {
|
|
data.trans_type = this.trans_type;
|
|
}
|
|
if (this.trade_type != null) {
|
|
data.trade_type = this.trade_type;
|
|
}
|
|
if (this.start != null) {
|
|
data.start = this.start;
|
|
}
|
|
if (this.end != null) {
|
|
data.end = this.end;
|
|
}
|
|
if (this.page != null) {
|
|
data.page = this.page;
|
|
}
|
|
if (this.page_size != null) {
|
|
data.page_size = this.page_size;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.trans_type != 0)
|
|
writer.writeInt64(1, this.trans_type);
|
|
if (this.trade_type != 0)
|
|
writer.writeInt64(2, this.trade_type);
|
|
if (this.start.length)
|
|
writer.writeString(3, this.start);
|
|
if (this.end.length)
|
|
writer.writeString(4, this.end);
|
|
if (this.page != 0)
|
|
writer.writeInt64(5, this.page);
|
|
if (this.page_size != 0)
|
|
writer.writeInt64(6, this.page_size);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TransactionsRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TransactionsRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.trans_type = reader.readInt64();
|
|
break;
|
|
case 2:
|
|
message.trade_type = reader.readInt64();
|
|
break;
|
|
case 3:
|
|
message.start = reader.readString();
|
|
break;
|
|
case 4:
|
|
message.end = reader.readString();
|
|
break;
|
|
case 5:
|
|
message.page = reader.readInt64();
|
|
break;
|
|
case 6:
|
|
message.page_size = reader.readInt64();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): TransactionsRequest {
|
|
return TransactionsRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class TransactionsReply extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
total?: number;
|
|
records?: Transaction[];
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("total" in data && data.total != undefined) {
|
|
this.total = data.total;
|
|
}
|
|
if ("records" in data && data.records != undefined) {
|
|
this.records = data.records;
|
|
}
|
|
}
|
|
}
|
|
get total() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set total(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get records() {
|
|
return pb_1.Message.getRepeatedWrapperField(this, Transaction, 2) as Transaction[];
|
|
}
|
|
set records(value: Transaction[]) {
|
|
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
|
}
|
|
static fromObject(data: {
|
|
total?: number;
|
|
records?: ReturnType<typeof Transaction.prototype.toObject>[];
|
|
}): TransactionsReply {
|
|
const message = new TransactionsReply({});
|
|
if (data.total != null) {
|
|
message.total = data.total;
|
|
}
|
|
if (data.records != null) {
|
|
message.records = data.records.map(item => Transaction.fromObject(item));
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
total?: number;
|
|
records?: ReturnType<typeof Transaction.prototype.toObject>[];
|
|
} = {};
|
|
if (this.total != null) {
|
|
data.total = this.total;
|
|
}
|
|
if (this.records != null) {
|
|
data.records = this.records.map((item: Transaction) => item.toObject());
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.total != 0)
|
|
writer.writeInt64(1, this.total);
|
|
if (this.records.length)
|
|
writer.writeRepeatedMessage(2, this.records, (item: Transaction) => item.serialize(writer));
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TransactionsReply {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TransactionsReply();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.total = reader.readInt64();
|
|
break;
|
|
case 2:
|
|
reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Transaction.deserialize(reader), Transaction));
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): TransactionsReply {
|
|
return TransactionsReply.deserialize(bytes);
|
|
}
|
|
}
|
|
export class Transaction extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
trans_type?: number;
|
|
trade_type?: number;
|
|
in_trade_no?: string;
|
|
out_trade_no?: string;
|
|
money?: number;
|
|
fee?: number;
|
|
pay_channel?: number;
|
|
pay_type?: string;
|
|
created?: string;
|
|
remark?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("trans_type" in data && data.trans_type != undefined) {
|
|
this.trans_type = data.trans_type;
|
|
}
|
|
if ("trade_type" in data && data.trade_type != undefined) {
|
|
this.trade_type = data.trade_type;
|
|
}
|
|
if ("in_trade_no" in data && data.in_trade_no != undefined) {
|
|
this.in_trade_no = data.in_trade_no;
|
|
}
|
|
if ("out_trade_no" in data && data.out_trade_no != undefined) {
|
|
this.out_trade_no = data.out_trade_no;
|
|
}
|
|
if ("money" in data && data.money != undefined) {
|
|
this.money = data.money;
|
|
}
|
|
if ("fee" in data && data.fee != undefined) {
|
|
this.fee = data.fee;
|
|
}
|
|
if ("pay_channel" in data && data.pay_channel != undefined) {
|
|
this.pay_channel = data.pay_channel;
|
|
}
|
|
if ("pay_type" in data && data.pay_type != undefined) {
|
|
this.pay_type = data.pay_type;
|
|
}
|
|
if ("created" in data && data.created != undefined) {
|
|
this.created = data.created;
|
|
}
|
|
if ("remark" in data && data.remark != undefined) {
|
|
this.remark = data.remark;
|
|
}
|
|
}
|
|
}
|
|
get trans_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set trans_type(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get trade_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
|
}
|
|
set trade_type(value: number) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get in_trade_no() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
}
|
|
set in_trade_no(value: string) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get out_trade_no() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
|
}
|
|
set out_trade_no(value: string) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
get money() {
|
|
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
|
|
}
|
|
set money(value: number) {
|
|
pb_1.Message.setField(this, 5, value);
|
|
}
|
|
get fee() {
|
|
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
|
|
}
|
|
set fee(value: number) {
|
|
pb_1.Message.setField(this, 6, value);
|
|
}
|
|
get pay_channel() {
|
|
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
|
|
}
|
|
set pay_channel(value: number) {
|
|
pb_1.Message.setField(this, 7, value);
|
|
}
|
|
get pay_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
|
|
}
|
|
set pay_type(value: string) {
|
|
pb_1.Message.setField(this, 8, value);
|
|
}
|
|
get created() {
|
|
return pb_1.Message.getFieldWithDefault(this, 9, "") as string;
|
|
}
|
|
set created(value: string) {
|
|
pb_1.Message.setField(this, 9, value);
|
|
}
|
|
get remark() {
|
|
return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
|
|
}
|
|
set remark(value: string) {
|
|
pb_1.Message.setField(this, 10, value);
|
|
}
|
|
static fromObject(data: {
|
|
trans_type?: number;
|
|
trade_type?: number;
|
|
in_trade_no?: string;
|
|
out_trade_no?: string;
|
|
money?: number;
|
|
fee?: number;
|
|
pay_channel?: number;
|
|
pay_type?: string;
|
|
created?: string;
|
|
remark?: string;
|
|
}): Transaction {
|
|
const message = new Transaction({});
|
|
if (data.trans_type != null) {
|
|
message.trans_type = data.trans_type;
|
|
}
|
|
if (data.trade_type != null) {
|
|
message.trade_type = data.trade_type;
|
|
}
|
|
if (data.in_trade_no != null) {
|
|
message.in_trade_no = data.in_trade_no;
|
|
}
|
|
if (data.out_trade_no != null) {
|
|
message.out_trade_no = data.out_trade_no;
|
|
}
|
|
if (data.money != null) {
|
|
message.money = data.money;
|
|
}
|
|
if (data.fee != null) {
|
|
message.fee = data.fee;
|
|
}
|
|
if (data.pay_channel != null) {
|
|
message.pay_channel = data.pay_channel;
|
|
}
|
|
if (data.pay_type != null) {
|
|
message.pay_type = data.pay_type;
|
|
}
|
|
if (data.created != null) {
|
|
message.created = data.created;
|
|
}
|
|
if (data.remark != null) {
|
|
message.remark = data.remark;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
trans_type?: number;
|
|
trade_type?: number;
|
|
in_trade_no?: string;
|
|
out_trade_no?: string;
|
|
money?: number;
|
|
fee?: number;
|
|
pay_channel?: number;
|
|
pay_type?: string;
|
|
created?: string;
|
|
remark?: string;
|
|
} = {};
|
|
if (this.trans_type != null) {
|
|
data.trans_type = this.trans_type;
|
|
}
|
|
if (this.trade_type != null) {
|
|
data.trade_type = this.trade_type;
|
|
}
|
|
if (this.in_trade_no != null) {
|
|
data.in_trade_no = this.in_trade_no;
|
|
}
|
|
if (this.out_trade_no != null) {
|
|
data.out_trade_no = this.out_trade_no;
|
|
}
|
|
if (this.money != null) {
|
|
data.money = this.money;
|
|
}
|
|
if (this.fee != null) {
|
|
data.fee = this.fee;
|
|
}
|
|
if (this.pay_channel != null) {
|
|
data.pay_channel = this.pay_channel;
|
|
}
|
|
if (this.pay_type != null) {
|
|
data.pay_type = this.pay_type;
|
|
}
|
|
if (this.created != null) {
|
|
data.created = this.created;
|
|
}
|
|
if (this.remark != null) {
|
|
data.remark = this.remark;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.trans_type != 0)
|
|
writer.writeInt32(1, this.trans_type);
|
|
if (this.trade_type != 0)
|
|
writer.writeInt32(2, this.trade_type);
|
|
if (this.in_trade_no.length)
|
|
writer.writeString(3, this.in_trade_no);
|
|
if (this.out_trade_no.length)
|
|
writer.writeString(4, this.out_trade_no);
|
|
if (this.money != 0)
|
|
writer.writeInt64(5, this.money);
|
|
if (this.fee != 0)
|
|
writer.writeInt64(6, this.fee);
|
|
if (this.pay_channel != 0)
|
|
writer.writeInt32(7, this.pay_channel);
|
|
if (this.pay_type.length)
|
|
writer.writeString(8, this.pay_type);
|
|
if (this.created.length)
|
|
writer.writeString(9, this.created);
|
|
if (this.remark.length)
|
|
writer.writeString(10, this.remark);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transaction {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Transaction();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.trans_type = reader.readInt32();
|
|
break;
|
|
case 2:
|
|
message.trade_type = reader.readInt32();
|
|
break;
|
|
case 3:
|
|
message.in_trade_no = reader.readString();
|
|
break;
|
|
case 4:
|
|
message.out_trade_no = reader.readString();
|
|
break;
|
|
case 5:
|
|
message.money = reader.readInt64();
|
|
break;
|
|
case 6:
|
|
message.fee = reader.readInt64();
|
|
break;
|
|
case 7:
|
|
message.pay_channel = reader.readInt32();
|
|
break;
|
|
case 8:
|
|
message.pay_type = reader.readString();
|
|
break;
|
|
case 9:
|
|
message.created = reader.readString();
|
|
break;
|
|
case 10:
|
|
message.remark = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): Transaction {
|
|
return Transaction.deserialize(bytes);
|
|
}
|
|
}
|
|
export class SetPayPasswordRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
passport_identity?: string;
|
|
password?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("passport_identity" in data && data.passport_identity != undefined) {
|
|
this.passport_identity = data.passport_identity;
|
|
}
|
|
if ("password" in data && data.password != undefined) {
|
|
this.password = data.password;
|
|
}
|
|
}
|
|
}
|
|
get passport_identity() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
|
}
|
|
set passport_identity(value: string) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get password() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set password(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
static fromObject(data: {
|
|
passport_identity?: string;
|
|
password?: string;
|
|
}): SetPayPasswordRequest {
|
|
const message = new SetPayPasswordRequest({});
|
|
if (data.passport_identity != null) {
|
|
message.passport_identity = data.passport_identity;
|
|
}
|
|
if (data.password != null) {
|
|
message.password = data.password;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
passport_identity?: string;
|
|
password?: string;
|
|
} = {};
|
|
if (this.passport_identity != null) {
|
|
data.passport_identity = this.passport_identity;
|
|
}
|
|
if (this.password != null) {
|
|
data.password = this.password;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.passport_identity.length)
|
|
writer.writeString(1, this.passport_identity);
|
|
if (this.password.length)
|
|
writer.writeString(2, this.password);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SetPayPasswordRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SetPayPasswordRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.passport_identity = reader.readString();
|
|
break;
|
|
case 2:
|
|
message.password = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): SetPayPasswordRequest {
|
|
return SetPayPasswordRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class BindPaymentIDRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
pay_type?: number;
|
|
auth_code?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("pay_type" in data && data.pay_type != undefined) {
|
|
this.pay_type = data.pay_type;
|
|
}
|
|
if ("auth_code" in data && data.auth_code != undefined) {
|
|
this.auth_code = data.auth_code;
|
|
}
|
|
}
|
|
}
|
|
get pay_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set pay_type(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get auth_code() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set auth_code(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
static fromObject(data: {
|
|
pay_type?: number;
|
|
auth_code?: string;
|
|
}): BindPaymentIDRequest {
|
|
const message = new BindPaymentIDRequest({});
|
|
if (data.pay_type != null) {
|
|
message.pay_type = data.pay_type;
|
|
}
|
|
if (data.auth_code != null) {
|
|
message.auth_code = data.auth_code;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
pay_type?: number;
|
|
auth_code?: string;
|
|
} = {};
|
|
if (this.pay_type != null) {
|
|
data.pay_type = this.pay_type;
|
|
}
|
|
if (this.auth_code != null) {
|
|
data.auth_code = this.auth_code;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.pay_type != 0)
|
|
writer.writeInt32(1, this.pay_type);
|
|
if (this.auth_code.length)
|
|
writer.writeString(2, this.auth_code);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BindPaymentIDRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BindPaymentIDRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.pay_type = reader.readInt32();
|
|
break;
|
|
case 2:
|
|
message.auth_code = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): BindPaymentIDRequest {
|
|
return BindPaymentIDRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class RefundRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
user_identification?: string;
|
|
amount?: number;
|
|
fee?: number;
|
|
remark?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("user_identification" in data && data.user_identification != undefined) {
|
|
this.user_identification = data.user_identification;
|
|
}
|
|
if ("amount" in data && data.amount != undefined) {
|
|
this.amount = data.amount;
|
|
}
|
|
if ("fee" in data && data.fee != undefined) {
|
|
this.fee = data.fee;
|
|
}
|
|
if ("remark" in data && data.remark != undefined) {
|
|
this.remark = data.remark;
|
|
}
|
|
}
|
|
}
|
|
get user_identification() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
|
}
|
|
set user_identification(value: string) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get amount() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
|
}
|
|
set amount(value: number) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get fee() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
|
|
}
|
|
set fee(value: number) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get remark() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
|
}
|
|
set remark(value: string) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
static fromObject(data: {
|
|
user_identification?: string;
|
|
amount?: number;
|
|
fee?: number;
|
|
remark?: string;
|
|
}): RefundRequest {
|
|
const message = new RefundRequest({});
|
|
if (data.user_identification != null) {
|
|
message.user_identification = data.user_identification;
|
|
}
|
|
if (data.amount != null) {
|
|
message.amount = data.amount;
|
|
}
|
|
if (data.fee != null) {
|
|
message.fee = data.fee;
|
|
}
|
|
if (data.remark != null) {
|
|
message.remark = data.remark;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
user_identification?: string;
|
|
amount?: number;
|
|
fee?: number;
|
|
remark?: string;
|
|
} = {};
|
|
if (this.user_identification != null) {
|
|
data.user_identification = this.user_identification;
|
|
}
|
|
if (this.amount != null) {
|
|
data.amount = this.amount;
|
|
}
|
|
if (this.fee != null) {
|
|
data.fee = this.fee;
|
|
}
|
|
if (this.remark != null) {
|
|
data.remark = this.remark;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.user_identification.length)
|
|
writer.writeString(1, this.user_identification);
|
|
if (this.amount != 0)
|
|
writer.writeInt64(2, this.amount);
|
|
if (this.fee != 0)
|
|
writer.writeInt64(3, this.fee);
|
|
if (this.remark.length)
|
|
writer.writeString(4, this.remark);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RefundRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RefundRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.user_identification = reader.readString();
|
|
break;
|
|
case 2:
|
|
message.amount = reader.readInt64();
|
|
break;
|
|
case 3:
|
|
message.fee = reader.readInt64();
|
|
break;
|
|
case 4:
|
|
message.remark = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): RefundRequest {
|
|
return RefundRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class RefundReply extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
balance?: number;
|
|
transaction?: Transaction;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("balance" in data && data.balance != undefined) {
|
|
this.balance = data.balance;
|
|
}
|
|
if ("transaction" in data && data.transaction != undefined) {
|
|
this.transaction = data.transaction;
|
|
}
|
|
}
|
|
}
|
|
get balance() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set balance(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get transaction() {
|
|
return pb_1.Message.getWrapperField(this, Transaction, 2) as Transaction;
|
|
}
|
|
set transaction(value: Transaction) {
|
|
pb_1.Message.setWrapperField(this, 2, value);
|
|
}
|
|
get has_transaction() {
|
|
return pb_1.Message.getField(this, 2) != null;
|
|
}
|
|
static fromObject(data: {
|
|
balance?: number;
|
|
transaction?: ReturnType<typeof Transaction.prototype.toObject>;
|
|
}): RefundReply {
|
|
const message = new RefundReply({});
|
|
if (data.balance != null) {
|
|
message.balance = data.balance;
|
|
}
|
|
if (data.transaction != null) {
|
|
message.transaction = Transaction.fromObject(data.transaction);
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
balance?: number;
|
|
transaction?: ReturnType<typeof Transaction.prototype.toObject>;
|
|
} = {};
|
|
if (this.balance != null) {
|
|
data.balance = this.balance;
|
|
}
|
|
if (this.transaction != null) {
|
|
data.transaction = this.transaction.toObject();
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.balance != 0)
|
|
writer.writeInt64(1, this.balance);
|
|
if (this.has_transaction)
|
|
writer.writeMessage(2, this.transaction, () => this.transaction.serialize(writer));
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RefundReply {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RefundReply();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.balance = reader.readInt64();
|
|
break;
|
|
case 2:
|
|
reader.readMessage(message.transaction, () => message.transaction = Transaction.deserialize(reader));
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): RefundReply {
|
|
return RefundReply.deserialize(bytes);
|
|
}
|
|
}
|
|
export class AddBankCardRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
wallet_identity?: string;
|
|
card_no?: string;
|
|
card_owner?: string;
|
|
id_card?: string;
|
|
phone?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("wallet_identity" in data && data.wallet_identity != undefined) {
|
|
this.wallet_identity = data.wallet_identity;
|
|
}
|
|
if ("card_no" in data && data.card_no != undefined) {
|
|
this.card_no = data.card_no;
|
|
}
|
|
if ("card_owner" in data && data.card_owner != undefined) {
|
|
this.card_owner = data.card_owner;
|
|
}
|
|
if ("id_card" in data && data.id_card != undefined) {
|
|
this.id_card = data.id_card;
|
|
}
|
|
if ("phone" in data && data.phone != undefined) {
|
|
this.phone = data.phone;
|
|
}
|
|
}
|
|
}
|
|
get wallet_identity() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
|
}
|
|
set wallet_identity(value: string) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get card_no() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set card_no(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get card_owner() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
}
|
|
set card_owner(value: string) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get id_card() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
|
}
|
|
set id_card(value: string) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
get phone() {
|
|
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
|
|
}
|
|
set phone(value: string) {
|
|
pb_1.Message.setField(this, 5, value);
|
|
}
|
|
static fromObject(data: {
|
|
wallet_identity?: string;
|
|
card_no?: string;
|
|
card_owner?: string;
|
|
id_card?: string;
|
|
phone?: string;
|
|
}): AddBankCardRequest {
|
|
const message = new AddBankCardRequest({});
|
|
if (data.wallet_identity != null) {
|
|
message.wallet_identity = data.wallet_identity;
|
|
}
|
|
if (data.card_no != null) {
|
|
message.card_no = data.card_no;
|
|
}
|
|
if (data.card_owner != null) {
|
|
message.card_owner = data.card_owner;
|
|
}
|
|
if (data.id_card != null) {
|
|
message.id_card = data.id_card;
|
|
}
|
|
if (data.phone != null) {
|
|
message.phone = data.phone;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
wallet_identity?: string;
|
|
card_no?: string;
|
|
card_owner?: string;
|
|
id_card?: string;
|
|
phone?: string;
|
|
} = {};
|
|
if (this.wallet_identity != null) {
|
|
data.wallet_identity = this.wallet_identity;
|
|
}
|
|
if (this.card_no != null) {
|
|
data.card_no = this.card_no;
|
|
}
|
|
if (this.card_owner != null) {
|
|
data.card_owner = this.card_owner;
|
|
}
|
|
if (this.id_card != null) {
|
|
data.id_card = this.id_card;
|
|
}
|
|
if (this.phone != null) {
|
|
data.phone = this.phone;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.wallet_identity.length)
|
|
writer.writeString(1, this.wallet_identity);
|
|
if (this.card_no.length)
|
|
writer.writeString(2, this.card_no);
|
|
if (this.card_owner.length)
|
|
writer.writeString(3, this.card_owner);
|
|
if (this.id_card.length)
|
|
writer.writeString(4, this.id_card);
|
|
if (this.phone.length)
|
|
writer.writeString(5, this.phone);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AddBankCardRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AddBankCardRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.wallet_identity = reader.readString();
|
|
break;
|
|
case 2:
|
|
message.card_no = reader.readString();
|
|
break;
|
|
case 3:
|
|
message.card_owner = reader.readString();
|
|
break;
|
|
case 4:
|
|
message.id_card = reader.readString();
|
|
break;
|
|
case 5:
|
|
message.phone = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): AddBankCardRequest {
|
|
return AddBankCardRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class FinanceEmpty extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") { }
|
|
}
|
|
static fromObject(data: {}): FinanceEmpty {
|
|
const message = new FinanceEmpty({});
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {} = {};
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FinanceEmpty {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FinanceEmpty();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): FinanceEmpty {
|
|
return FinanceEmpty.deserialize(bytes);
|
|
}
|
|
}
|
|
export class RmBankCardRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
identity?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("identity" in data && data.identity != undefined) {
|
|
this.identity = data.identity;
|
|
}
|
|
}
|
|
}
|
|
get identity() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set identity(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
static fromObject(data: {
|
|
identity?: string;
|
|
}): RmBankCardRequest {
|
|
const message = new RmBankCardRequest({});
|
|
if (data.identity != null) {
|
|
message.identity = data.identity;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
identity?: string;
|
|
} = {};
|
|
if (this.identity != null) {
|
|
data.identity = this.identity;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.identity.length)
|
|
writer.writeString(2, this.identity);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RmBankCardRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RmBankCardRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 2:
|
|
message.identity = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): RmBankCardRequest {
|
|
return RmBankCardRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class GetBankCardReply extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
data?: BankCardInfo[];
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("data" in data && data.data != undefined) {
|
|
this.data = data.data;
|
|
}
|
|
}
|
|
}
|
|
get data() {
|
|
return pb_1.Message.getRepeatedWrapperField(this, BankCardInfo, 1) as BankCardInfo[];
|
|
}
|
|
set data(value: BankCardInfo[]) {
|
|
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
|
}
|
|
static fromObject(data: {
|
|
data?: ReturnType<typeof BankCardInfo.prototype.toObject>[];
|
|
}): GetBankCardReply {
|
|
const message = new GetBankCardReply({});
|
|
if (data.data != null) {
|
|
message.data = data.data.map(item => BankCardInfo.fromObject(item));
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
data?: ReturnType<typeof BankCardInfo.prototype.toObject>[];
|
|
} = {};
|
|
if (this.data != null) {
|
|
data.data = this.data.map((item: BankCardInfo) => item.toObject());
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.data.length)
|
|
writer.writeRepeatedMessage(1, this.data, (item: BankCardInfo) => item.serialize(writer));
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBankCardReply {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBankCardReply();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
reader.readMessage(message.data, () => pb_1.Message.addToRepeatedWrapperField(message, 1, BankCardInfo.deserialize(reader), BankCardInfo));
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): GetBankCardReply {
|
|
return GetBankCardReply.deserialize(bytes);
|
|
}
|
|
}
|
|
export class BankCardInfo extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
id?: number;
|
|
bank_number?: string;
|
|
bank_name?: string;
|
|
card_owner?: string;
|
|
id_card?: string;
|
|
phone?: string;
|
|
bind_id?: string;
|
|
bank_type?: string;
|
|
bank?: string;
|
|
created?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("id" in data && data.id != undefined) {
|
|
this.id = data.id;
|
|
}
|
|
if ("bank_number" in data && data.bank_number != undefined) {
|
|
this.bank_number = data.bank_number;
|
|
}
|
|
if ("bank_name" in data && data.bank_name != undefined) {
|
|
this.bank_name = data.bank_name;
|
|
}
|
|
if ("card_owner" in data && data.card_owner != undefined) {
|
|
this.card_owner = data.card_owner;
|
|
}
|
|
if ("id_card" in data && data.id_card != undefined) {
|
|
this.id_card = data.id_card;
|
|
}
|
|
if ("phone" in data && data.phone != undefined) {
|
|
this.phone = data.phone;
|
|
}
|
|
if ("bind_id" in data && data.bind_id != undefined) {
|
|
this.bind_id = data.bind_id;
|
|
}
|
|
if ("bank_type" in data && data.bank_type != undefined) {
|
|
this.bank_type = data.bank_type;
|
|
}
|
|
if ("bank" in data && data.bank != undefined) {
|
|
this.bank = data.bank;
|
|
}
|
|
if ("created" in data && data.created != undefined) {
|
|
this.created = data.created;
|
|
}
|
|
}
|
|
}
|
|
get id() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set id(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get bank_number() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set bank_number(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get bank_name() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
}
|
|
set bank_name(value: string) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
get card_owner() {
|
|
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
|
}
|
|
set card_owner(value: string) {
|
|
pb_1.Message.setField(this, 4, value);
|
|
}
|
|
get id_card() {
|
|
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
|
|
}
|
|
set id_card(value: string) {
|
|
pb_1.Message.setField(this, 5, value);
|
|
}
|
|
get phone() {
|
|
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
|
}
|
|
set phone(value: string) {
|
|
pb_1.Message.setField(this, 6, value);
|
|
}
|
|
get bind_id() {
|
|
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
|
|
}
|
|
set bind_id(value: string) {
|
|
pb_1.Message.setField(this, 7, value);
|
|
}
|
|
get bank_type() {
|
|
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
|
|
}
|
|
set bank_type(value: string) {
|
|
pb_1.Message.setField(this, 8, value);
|
|
}
|
|
get bank() {
|
|
return pb_1.Message.getFieldWithDefault(this, 9, "") as string;
|
|
}
|
|
set bank(value: string) {
|
|
pb_1.Message.setField(this, 9, value);
|
|
}
|
|
get created() {
|
|
return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
|
|
}
|
|
set created(value: string) {
|
|
pb_1.Message.setField(this, 10, value);
|
|
}
|
|
static fromObject(data: {
|
|
id?: number;
|
|
bank_number?: string;
|
|
bank_name?: string;
|
|
card_owner?: string;
|
|
id_card?: string;
|
|
phone?: string;
|
|
bind_id?: string;
|
|
bank_type?: string;
|
|
bank?: string;
|
|
created?: string;
|
|
}): BankCardInfo {
|
|
const message = new BankCardInfo({});
|
|
if (data.id != null) {
|
|
message.id = data.id;
|
|
}
|
|
if (data.bank_number != null) {
|
|
message.bank_number = data.bank_number;
|
|
}
|
|
if (data.bank_name != null) {
|
|
message.bank_name = data.bank_name;
|
|
}
|
|
if (data.card_owner != null) {
|
|
message.card_owner = data.card_owner;
|
|
}
|
|
if (data.id_card != null) {
|
|
message.id_card = data.id_card;
|
|
}
|
|
if (data.phone != null) {
|
|
message.phone = data.phone;
|
|
}
|
|
if (data.bind_id != null) {
|
|
message.bind_id = data.bind_id;
|
|
}
|
|
if (data.bank_type != null) {
|
|
message.bank_type = data.bank_type;
|
|
}
|
|
if (data.bank != null) {
|
|
message.bank = data.bank;
|
|
}
|
|
if (data.created != null) {
|
|
message.created = data.created;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
id?: number;
|
|
bank_number?: string;
|
|
bank_name?: string;
|
|
card_owner?: string;
|
|
id_card?: string;
|
|
phone?: string;
|
|
bind_id?: string;
|
|
bank_type?: string;
|
|
bank?: string;
|
|
created?: string;
|
|
} = {};
|
|
if (this.id != null) {
|
|
data.id = this.id;
|
|
}
|
|
if (this.bank_number != null) {
|
|
data.bank_number = this.bank_number;
|
|
}
|
|
if (this.bank_name != null) {
|
|
data.bank_name = this.bank_name;
|
|
}
|
|
if (this.card_owner != null) {
|
|
data.card_owner = this.card_owner;
|
|
}
|
|
if (this.id_card != null) {
|
|
data.id_card = this.id_card;
|
|
}
|
|
if (this.phone != null) {
|
|
data.phone = this.phone;
|
|
}
|
|
if (this.bind_id != null) {
|
|
data.bind_id = this.bind_id;
|
|
}
|
|
if (this.bank_type != null) {
|
|
data.bank_type = this.bank_type;
|
|
}
|
|
if (this.bank != null) {
|
|
data.bank = this.bank;
|
|
}
|
|
if (this.created != null) {
|
|
data.created = this.created;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.id != 0)
|
|
writer.writeInt64(1, this.id);
|
|
if (this.bank_number.length)
|
|
writer.writeString(2, this.bank_number);
|
|
if (this.bank_name.length)
|
|
writer.writeString(3, this.bank_name);
|
|
if (this.card_owner.length)
|
|
writer.writeString(4, this.card_owner);
|
|
if (this.id_card.length)
|
|
writer.writeString(5, this.id_card);
|
|
if (this.phone.length)
|
|
writer.writeString(6, this.phone);
|
|
if (this.bind_id.length)
|
|
writer.writeString(7, this.bind_id);
|
|
if (this.bank_type.length)
|
|
writer.writeString(8, this.bank_type);
|
|
if (this.bank.length)
|
|
writer.writeString(9, this.bank);
|
|
if (this.created.length)
|
|
writer.writeString(10, this.created);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BankCardInfo {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BankCardInfo();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.id = reader.readInt64();
|
|
break;
|
|
case 2:
|
|
message.bank_number = reader.readString();
|
|
break;
|
|
case 3:
|
|
message.bank_name = reader.readString();
|
|
break;
|
|
case 4:
|
|
message.card_owner = reader.readString();
|
|
break;
|
|
case 5:
|
|
message.id_card = reader.readString();
|
|
break;
|
|
case 6:
|
|
message.phone = reader.readString();
|
|
break;
|
|
case 7:
|
|
message.bind_id = reader.readString();
|
|
break;
|
|
case 8:
|
|
message.bank_type = reader.readString();
|
|
break;
|
|
case 9:
|
|
message.bank = reader.readString();
|
|
break;
|
|
case 10:
|
|
message.created = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): BankCardInfo {
|
|
return BankCardInfo.deserialize(bytes);
|
|
}
|
|
}
|
|
export class ApplyCashRequest extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
channel?: number;
|
|
amount?: number;
|
|
remark?: string;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("channel" in data && data.channel != undefined) {
|
|
this.channel = data.channel;
|
|
}
|
|
if ("amount" in data && data.amount != undefined) {
|
|
this.amount = data.amount;
|
|
}
|
|
if ("remark" in data && data.remark != undefined) {
|
|
this.remark = data.remark;
|
|
}
|
|
}
|
|
}
|
|
get channel() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set channel(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get amount() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
|
}
|
|
set amount(value: number) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get remark() {
|
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
}
|
|
set remark(value: string) {
|
|
pb_1.Message.setField(this, 3, value);
|
|
}
|
|
static fromObject(data: {
|
|
channel?: number;
|
|
amount?: number;
|
|
remark?: string;
|
|
}): ApplyCashRequest {
|
|
const message = new ApplyCashRequest({});
|
|
if (data.channel != null) {
|
|
message.channel = data.channel;
|
|
}
|
|
if (data.amount != null) {
|
|
message.amount = data.amount;
|
|
}
|
|
if (data.remark != null) {
|
|
message.remark = data.remark;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
channel?: number;
|
|
amount?: number;
|
|
remark?: string;
|
|
} = {};
|
|
if (this.channel != null) {
|
|
data.channel = this.channel;
|
|
}
|
|
if (this.amount != null) {
|
|
data.amount = this.amount;
|
|
}
|
|
if (this.remark != null) {
|
|
data.remark = this.remark;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.channel != 0)
|
|
writer.writeInt32(1, this.channel);
|
|
if (this.amount != 0)
|
|
writer.writeInt64(2, this.amount);
|
|
if (this.remark.length)
|
|
writer.writeString(3, this.remark);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ApplyCashRequest {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ApplyCashRequest();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.channel = reader.readInt32();
|
|
break;
|
|
case 2:
|
|
message.amount = reader.readInt64();
|
|
break;
|
|
case 3:
|
|
message.remark = reader.readString();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): ApplyCashRequest {
|
|
return ApplyCashRequest.deserialize(bytes);
|
|
}
|
|
}
|
|
export class CodeReply extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
code?: number;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("code" in data && data.code != undefined) {
|
|
this.code = data.code;
|
|
}
|
|
}
|
|
}
|
|
get code() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
|
}
|
|
set code(value: number) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
static fromObject(data: {
|
|
code?: number;
|
|
}): CodeReply {
|
|
const message = new CodeReply({});
|
|
if (data.code != null) {
|
|
message.code = data.code;
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
code?: number;
|
|
} = {};
|
|
if (this.code != null) {
|
|
data.code = this.code;
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.code != 0)
|
|
writer.writeInt32(1, this.code);
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CodeReply {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CodeReply();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.code = reader.readInt32();
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): CodeReply {
|
|
return CodeReply.deserialize(bytes);
|
|
}
|
|
}
|
|
interface GrpcUnaryServiceInterface<P, R> {
|
|
(message: P, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
|
(message: P, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
|
(message: P, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
|
(message: P, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
|
}
|
|
interface GrpcStreamServiceInterface<P, R> {
|
|
(message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream<R>;
|
|
(message: P, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream<R>;
|
|
}
|
|
interface GrpWritableServiceInterface<P, R> {
|
|
(metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
|
|
(metadata: grpc_1.Metadata, callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
|
|
(options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
|
|
(callback: grpc_1.requestCallback<R>): grpc_1.ClientWritableStream<P>;
|
|
}
|
|
interface GrpcChunkServiceInterface<P, R> {
|
|
(metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream<P, R>;
|
|
(options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream<P, R>;
|
|
}
|
|
interface GrpcPromiseServiceInterface<P, R> {
|
|
(message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): Promise<R>;
|
|
(message: P, options?: grpc_1.CallOptions): Promise<R>;
|
|
}
|
|
export abstract class UnimplementedBasicService {
|
|
static definition = {
|
|
GetWallet: {
|
|
path: "/wallet.Basic/GetWallet",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: GetWalletRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => GetWalletRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: GetWalletReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => GetWalletReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
SetPayPassword: {
|
|
path: "/wallet.Basic/SetPayPassword",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: SetPayPasswordRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => SetPayPasswordRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: CodeReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => CodeReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
BindPaymentId: {
|
|
path: "/wallet.Basic/BindPaymentId",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: BindPaymentIDRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => BindPaymentIDRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: CodeReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => CodeReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
Transactions: {
|
|
path: "/wallet.Basic/Transactions",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: TransactionsRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => TransactionsRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: TransactionsReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => TransactionsReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
AddBankCard: {
|
|
path: "/wallet.Basic/AddBankCard",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: AddBankCardRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => AddBankCardRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: CodeReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => CodeReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
GetBankCard: {
|
|
path: "/wallet.Basic/GetBankCard",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: FinanceEmpty) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => FinanceEmpty.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: GetBankCardReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => GetBankCardReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
RmBankCard: {
|
|
path: "/wallet.Basic/RmBankCard",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: RmBankCardRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => RmBankCardRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: CodeReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => CodeReply.deserialize(new Uint8Array(bytes))
|
|
},
|
|
ApplyCash: {
|
|
path: "/wallet.Basic/ApplyCash",
|
|
requestStream: false,
|
|
responseStream: false,
|
|
requestSerialize: (message: ApplyCashRequest) => Buffer.from(message.serialize()),
|
|
requestDeserialize: (bytes: Buffer) => ApplyCashRequest.deserialize(new Uint8Array(bytes)),
|
|
responseSerialize: (message: CodeReply) => Buffer.from(message.serialize()),
|
|
responseDeserialize: (bytes: Buffer) => CodeReply.deserialize(new Uint8Array(bytes))
|
|
}
|
|
};
|
|
[method: string]: grpc_1.UntypedHandleCall;
|
|
abstract GetWallet(call: grpc_1.ServerUnaryCall<GetWalletRequest, GetWalletReply>, callback: grpc_1.sendUnaryData<GetWalletReply>): void;
|
|
abstract SetPayPassword(call: grpc_1.ServerUnaryCall<SetPayPasswordRequest, CodeReply>, callback: grpc_1.sendUnaryData<CodeReply>): void;
|
|
abstract BindPaymentId(call: grpc_1.ServerUnaryCall<BindPaymentIDRequest, CodeReply>, callback: grpc_1.sendUnaryData<CodeReply>): void;
|
|
abstract Transactions(call: grpc_1.ServerUnaryCall<TransactionsRequest, TransactionsReply>, callback: grpc_1.sendUnaryData<TransactionsReply>): void;
|
|
abstract AddBankCard(call: grpc_1.ServerUnaryCall<AddBankCardRequest, CodeReply>, callback: grpc_1.sendUnaryData<CodeReply>): void;
|
|
abstract GetBankCard(call: grpc_1.ServerUnaryCall<FinanceEmpty, GetBankCardReply>, callback: grpc_1.sendUnaryData<GetBankCardReply>): void;
|
|
abstract RmBankCard(call: grpc_1.ServerUnaryCall<RmBankCardRequest, CodeReply>, callback: grpc_1.sendUnaryData<CodeReply>): void;
|
|
abstract ApplyCash(call: grpc_1.ServerUnaryCall<ApplyCashRequest, CodeReply>, callback: grpc_1.sendUnaryData<CodeReply>): void;
|
|
}
|
|
export class BasicClient extends grpc_1.makeGenericClientConstructor(UnimplementedBasicService.definition, "Basic", {}) {
|
|
constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial<grpc_1.ChannelOptions>) {
|
|
super(address, credentials, options);
|
|
}
|
|
GetWallet: GrpcUnaryServiceInterface<GetWalletRequest, GetWalletReply> = (message: GetWalletRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<GetWalletReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<GetWalletReply>, callback?: grpc_1.requestCallback<GetWalletReply>): grpc_1.ClientUnaryCall => {
|
|
return super.GetWallet(message, metadata, options, callback);
|
|
};
|
|
SetPayPassword: GrpcUnaryServiceInterface<SetPayPasswordRequest, CodeReply> = (message: SetPayPasswordRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, callback?: grpc_1.requestCallback<CodeReply>): grpc_1.ClientUnaryCall => {
|
|
return super.SetPayPassword(message, metadata, options, callback);
|
|
};
|
|
BindPaymentId: GrpcUnaryServiceInterface<BindPaymentIDRequest, CodeReply> = (message: BindPaymentIDRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, callback?: grpc_1.requestCallback<CodeReply>): grpc_1.ClientUnaryCall => {
|
|
return super.BindPaymentId(message, metadata, options, callback);
|
|
};
|
|
Transactions: GrpcUnaryServiceInterface<TransactionsRequest, TransactionsReply> = (message: TransactionsRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<TransactionsReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<TransactionsReply>, callback?: grpc_1.requestCallback<TransactionsReply>): grpc_1.ClientUnaryCall => {
|
|
return super.Transactions(message, metadata, options, callback);
|
|
};
|
|
AddBankCard: GrpcUnaryServiceInterface<AddBankCardRequest, CodeReply> = (message: AddBankCardRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, callback?: grpc_1.requestCallback<CodeReply>): grpc_1.ClientUnaryCall => {
|
|
return super.AddBankCard(message, metadata, options, callback);
|
|
};
|
|
GetBankCard: GrpcUnaryServiceInterface<FinanceEmpty, GetBankCardReply> = (message: FinanceEmpty, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<GetBankCardReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<GetBankCardReply>, callback?: grpc_1.requestCallback<GetBankCardReply>): grpc_1.ClientUnaryCall => {
|
|
return super.GetBankCard(message, metadata, options, callback);
|
|
};
|
|
RmBankCard: GrpcUnaryServiceInterface<RmBankCardRequest, CodeReply> = (message: RmBankCardRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, callback?: grpc_1.requestCallback<CodeReply>): grpc_1.ClientUnaryCall => {
|
|
return super.RmBankCard(message, metadata, options, callback);
|
|
};
|
|
ApplyCash: GrpcUnaryServiceInterface<ApplyCashRequest, CodeReply> = (message: ApplyCashRequest, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, options?: grpc_1.CallOptions | grpc_1.requestCallback<CodeReply>, callback?: grpc_1.requestCallback<CodeReply>): grpc_1.ClientUnaryCall => {
|
|
return super.ApplyCash(message, metadata, options, callback);
|
|
};
|
|
}
|
|
}
|