Skip to content

Commit

Permalink
include bank proto changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dssei committed Sep 13, 2024
1 parent 74fdc13 commit 31314df
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 12 deletions.
6 changes: 6 additions & 0 deletions packages/proto/proto/cosmos/bank/v1beta1/bank.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,9 @@ message Metadata {
// Since: cosmos-sdk 0.43
string symbol = 6;
}

message AllowList {
option (gogoproto.equal) = true;

repeated string addresses = 1 [ (gogoproto.moretags) = "yaml:\"addresses\"" ];
}
88 changes: 88 additions & 0 deletions packages/proto/src/codegen/cosmos/bank/v1beta1/bank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,23 @@ export interface MetadataSDKType {
name: string;
symbol: string;
}
export interface AllowList {
addresses: string[];
}
export interface AllowListProtoMsg {
typeUrl: "/cosmos.bank.v1beta1.AllowList";
value: Uint8Array;
}
export interface AllowListAmino {
addresses?: string[];
}
export interface AllowListAminoMsg {
type: "cosmos-sdk/AllowList";
value: AllowListAmino;
}
export interface AllowListSDKType {
addresses: string[];
}
function createBaseParams(): Params {
return {
sendEnabled: [],
Expand Down Expand Up @@ -896,4 +913,75 @@ export const Metadata = {
value: Metadata.encode(message).finish()
};
}
};
function createBaseAllowList(): AllowList {
return {
addresses: []
};
}
export const AllowList = {
typeUrl: "/cosmos.bank.v1beta1.AllowList",
encode(message: AllowList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
for (const v of message.addresses) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): AllowList {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAllowList();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.addresses.push(reader.string());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<AllowList>): AllowList {
const message = createBaseAllowList();
message.addresses = object.addresses?.map(e => e) || [];
return message;
},
fromAmino(object: AllowListAmino): AllowList {
const message = createBaseAllowList();
message.addresses = object.addresses?.map(e => e) || [];
return message;
},
toAmino(message: AllowList): AllowListAmino {
const obj: any = {};
if (message.addresses) {
obj.addresses = message.addresses.map(e => e);
} else {
obj.addresses = message.addresses;
}
return obj;
},
fromAminoMsg(object: AllowListAminoMsg): AllowList {
return AllowList.fromAmino(object.value);
},
toAminoMsg(message: AllowList): AllowListAminoMsg {
return {
type: "cosmos-sdk/AllowList",
value: AllowList.toAmino(message)
};
},
fromProtoMsg(message: AllowListProtoMsg): AllowList {
return AllowList.decode(message.value);
},
toProto(message: AllowList): Uint8Array {
return AllowList.encode(message).finish();
},
toProtoMsg(message: AllowList): AllowListProtoMsg {
return {
typeUrl: "/cosmos.bank.v1beta1.AllowList",
value: AllowList.encode(message).finish()
};
}
};
49 changes: 40 additions & 9 deletions packages/proto/src/codegen/tokenfactory/query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from '../cosmos/bank/v1beta1/bank';
import {
Params,
ParamsAmino,
ParamsSDKType,
Metadata,
MetadataAmino,
MetadataSDKType,
AllowList,
AllowListAmino,
AllowListSDKType
} from '../cosmos/bank/v1beta1/bank';
import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from './authorityMetadata';
import { BinaryReader, BinaryWriter } from '../binary';
/** QueryParamsRequest is the request type for the Query/Params RPC method. */
Expand Down Expand Up @@ -232,7 +242,10 @@ export interface QueryDenomAllowListRequestSDKType {
* QueryDenomAllowListResponse is the response type for the DenomAllowList gRPC
* method.
*/
export interface QueryDenomAllowListResponse {}
export interface QueryDenomAllowListResponse {
/** allow_list provides addresses allowed for the requested token. */
allowList: AllowList | undefined;
}
export interface QueryDenomAllowListResponseProtoMsg {
typeUrl: '/seiprotocol.seichain.tokenfactory.QueryDenomAllowListResponse';
value: Uint8Array;
Expand All @@ -241,7 +254,10 @@ export interface QueryDenomAllowListResponseProtoMsg {
* QueryDenomAllowListResponse is the response type for the DenomAllowList gRPC
* method.
*/
export interface QueryDenomAllowListResponseAmino {}
export interface QueryDenomAllowListResponseAmino {
/** allow_list provides addresses allowed for the requested token. */
allow_list?: AllowListAmino | undefined;
}
export interface QueryDenomAllowListResponseAminoMsg {
type: '/seiprotocol.seichain.tokenfactory.QueryDenomAllowListResponse';
value: QueryDenomAllowListResponseAmino;
Expand All @@ -250,7 +266,9 @@ export interface QueryDenomAllowListResponseAminoMsg {
* QueryDenomAllowListResponse is the response type for the DenomAllowList gRPC
* method.
*/
export interface QueryDenomAllowListResponseSDKType {}
export interface QueryDenomAllowListResponseSDKType {
allow_list: AllowListSDKType | undefined;
}
function createBaseQueryParamsRequest(): QueryParamsRequest {
return {};
}
Expand Down Expand Up @@ -809,11 +827,16 @@ export const QueryDenomAllowListRequest = {
}
};
function createBaseQueryDenomAllowListResponse(): QueryDenomAllowListResponse {
return {};
return {
allowList: AllowList.fromPartial({})
};
}
export const QueryDenomAllowListResponse = {
typeUrl: '/seiprotocol.seichain.tokenfactory.QueryDenomAllowListResponse',
encode(_: QueryDenomAllowListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
encode(message: QueryDenomAllowListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.allowList !== undefined) {
AllowList.encode(message.allowList, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomAllowListResponse {
Expand All @@ -823,23 +846,31 @@ export const QueryDenomAllowListResponse = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.allowList = AllowList.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(_: Partial<QueryDenomAllowListResponse>): QueryDenomAllowListResponse {
fromPartial(object: Partial<QueryDenomAllowListResponse>): QueryDenomAllowListResponse {
const message = createBaseQueryDenomAllowListResponse();
message.allowList = object.allowList !== undefined && object.allowList !== null ? AllowList.fromPartial(object.allowList) : undefined;
return message;
},
fromAmino(_: QueryDenomAllowListResponseAmino): QueryDenomAllowListResponse {
fromAmino(object: QueryDenomAllowListResponseAmino): QueryDenomAllowListResponse {
const message = createBaseQueryDenomAllowListResponse();
if (object.allow_list !== undefined && object.allow_list !== null) {
message.allowList = AllowList.fromAmino(object.allow_list);
}
return message;
},
toAmino(_: QueryDenomAllowListResponse): QueryDenomAllowListResponseAmino {
toAmino(message: QueryDenomAllowListResponse): QueryDenomAllowListResponseAmino {
const obj: any = {};
obj.allow_list = message.allowList ? AllowList.toAmino(message.allowList) : undefined;
return obj;
},
fromAminoMsg(object: QueryDenomAllowListResponseAminoMsg): QueryDenomAllowListResponse {
Expand Down
36 changes: 33 additions & 3 deletions packages/proto/src/codegen/tokenfactory/tx.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AllowList, AllowListAmino, AllowListSDKType, Metadata, MetadataAmino, MetadataSDKType } from '../cosmos/bank/v1beta1/bank';
import { Coin, CoinAmino, CoinSDKType } from '../cosmos/base/v1beta1/coin';
import { Metadata, MetadataAmino, MetadataSDKType } from '../cosmos/bank/v1beta1/bank';
import { BinaryReader, BinaryWriter } from '../binary';
/**
* MsgCreateDenom defines the message structure for the CreateDenom gRPC service
Expand All @@ -16,6 +16,7 @@ export interface MsgCreateDenom {
sender: string;
/** subdenom can be up to 44 "alphanumeric" characters long. */
subdenom: string;
allowList?: AllowList | undefined;
}
export interface MsgCreateDenomProtoMsg {
typeUrl: '/seiprotocol.seichain.tokenfactory.MsgCreateDenom';
Expand All @@ -36,6 +37,7 @@ export interface MsgCreateDenomAmino {
sender?: string;
/** subdenom can be up to 44 "alphanumeric" characters long. */
subdenom?: string;
allow_list?: AllowListAmino | undefined;
}
export interface MsgCreateDenomAminoMsg {
type: '/seiprotocol.seichain.tokenfactory.MsgCreateDenom';
Expand All @@ -55,6 +57,7 @@ export interface MsgCreateDenomAminoMsg {
export interface MsgCreateDenomSDKType {
sender: string;
subdenom: string;
allow_list?: AllowListSDKType | undefined;
}
/**
* MsgCreateDenomResponse is the return value of MsgCreateDenom
Expand Down Expand Up @@ -289,6 +292,7 @@ export interface MsgUpdateDenom {
sender: string;
/** subdenom can be up to 44 "alphanumeric" characters long. */
subdenom: string;
allowList?: AllowList | undefined;
}
export interface MsgUpdateDenomProtoMsg {
typeUrl: '/seiprotocol.seichain.tokenfactory.MsgUpdateDenom';
Expand All @@ -299,6 +303,7 @@ export interface MsgUpdateDenomAmino {
sender?: string;
/** subdenom can be up to 44 "alphanumeric" characters long. */
subdenom?: string;
allow_list?: AllowListAmino | undefined;
}
export interface MsgUpdateDenomAminoMsg {
type: '/seiprotocol.seichain.tokenfactory.MsgUpdateDenom';
Expand All @@ -308,6 +313,7 @@ export interface MsgUpdateDenomAminoMsg {
export interface MsgUpdateDenomSDKType {
sender: string;
subdenom: string;
allow_list?: AllowListSDKType | undefined;
}
/** MsgUpdateDenomResponse defines the response structure for an executed MsgUpdateDenom message. */
export interface MsgUpdateDenomResponse {}
Expand All @@ -326,7 +332,8 @@ export interface MsgUpdateDenomResponseSDKType {}
function createBaseMsgCreateDenom(): MsgCreateDenom {
return {
sender: '',
subdenom: ''
subdenom: '',
allowList: undefined
};
}
export const MsgCreateDenom = {
Expand All @@ -338,6 +345,9 @@ export const MsgCreateDenom = {
if (message.subdenom !== '') {
writer.uint32(18).string(message.subdenom);
}
if (message.allowList !== undefined) {
AllowList.encode(message.allowList, writer.uint32(26).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDenom {
Expand All @@ -353,6 +363,9 @@ export const MsgCreateDenom = {
case 2:
message.subdenom = reader.string();
break;
case 3:
message.allowList = AllowList.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
Expand All @@ -364,6 +377,7 @@ export const MsgCreateDenom = {
const message = createBaseMsgCreateDenom();
message.sender = object.sender ?? '';
message.subdenom = object.subdenom ?? '';
message.allowList = object.allowList !== undefined && object.allowList !== null ? AllowList.fromPartial(object.allowList) : undefined;
return message;
},
fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom {
Expand All @@ -374,12 +388,16 @@ export const MsgCreateDenom = {
if (object.subdenom !== undefined && object.subdenom !== null) {
message.subdenom = object.subdenom;
}
if (object.allow_list !== undefined && object.allow_list !== null) {
message.allowList = AllowList.fromAmino(object.allow_list);
}
return message;
},
toAmino(message: MsgCreateDenom): MsgCreateDenomAmino {
const obj: any = {};
obj.sender = message.sender === '' ? undefined : message.sender;
obj.subdenom = message.subdenom === '' ? undefined : message.subdenom;
obj.allow_list = message.allowList ? AllowList.toAmino(message.allowList) : undefined;
return obj;
},
fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom {
Expand Down Expand Up @@ -976,7 +994,8 @@ export const MsgSetDenomMetadataResponse = {
function createBaseMsgUpdateDenom(): MsgUpdateDenom {
return {
sender: '',
subdenom: ''
subdenom: '',
allowList: undefined
};
}
export const MsgUpdateDenom = {
Expand All @@ -988,6 +1007,9 @@ export const MsgUpdateDenom = {
if (message.subdenom !== '') {
writer.uint32(18).string(message.subdenom);
}
if (message.allowList !== undefined) {
AllowList.encode(message.allowList, writer.uint32(26).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDenom {
Expand All @@ -1003,6 +1025,9 @@ export const MsgUpdateDenom = {
case 2:
message.subdenom = reader.string();
break;
case 3:
message.allowList = AllowList.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
Expand All @@ -1014,6 +1039,7 @@ export const MsgUpdateDenom = {
const message = createBaseMsgUpdateDenom();
message.sender = object.sender ?? '';
message.subdenom = object.subdenom ?? '';
message.allowList = object.allowList !== undefined && object.allowList !== null ? AllowList.fromPartial(object.allowList) : undefined;
return message;
},
fromAmino(object: MsgUpdateDenomAmino): MsgUpdateDenom {
Expand All @@ -1024,12 +1050,16 @@ export const MsgUpdateDenom = {
if (object.subdenom !== undefined && object.subdenom !== null) {
message.subdenom = object.subdenom;
}
if (object.allow_list !== undefined && object.allow_list !== null) {
message.allowList = AllowList.fromAmino(object.allow_list);
}
return message;
},
toAmino(message: MsgUpdateDenom): MsgUpdateDenomAmino {
const obj: any = {};
obj.sender = message.sender === '' ? undefined : message.sender;
obj.subdenom = message.subdenom === '' ? undefined : message.subdenom;
obj.allow_list = message.allowList ? AllowList.toAmino(message.allowList) : undefined;
return obj;
},
fromAminoMsg(object: MsgUpdateDenomAminoMsg): MsgUpdateDenom {
Expand Down

0 comments on commit 31314df

Please sign in to comment.