Skip to content

Commit

Permalink
Apply updates from ibc
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed Jun 26, 2024
1 parent 5f438dc commit c284638
Show file tree
Hide file tree
Showing 18 changed files with 164 additions and 657 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia.js",
"version": "0.2.7",
"version": "0.2.8",
"description": "The JavaScript SDK for Initia",
"license": "MIT",
"author": "Initia Foundation",
Expand Down Expand Up @@ -86,7 +86,7 @@
"webpack-cli": "^4.10.0"
},
"dependencies": {
"@initia/initia.proto": "^0.2.0",
"@initia/initia.proto": "^0.2.1",
"@initia/opinit.proto": "^0.0.8",
"@ledgerhq/hw-transport": "^6.27.12",
"@ledgerhq/hw-transport-webhid": "^6.27.12",
Expand Down
3 changes: 0 additions & 3 deletions src/client/lcd/LCDClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
GovAPI,
GroupAPI,
IbcAPI,
IbcFetchpriceAPI,
IbcHooksAPI,
IbcNftAPI,
IbcTransferAPI,
Expand Down Expand Up @@ -96,7 +95,6 @@ export class LCDClient {
public gov: GovAPI;
public group: GroupAPI;
public ibc: IbcAPI;
public ibcFetchprice: IbcFetchpriceAPI;
public ibcHooks: IbcHooksAPI;
public ibcNft: IbcNftAPI;
public ibcTransfer: IbcTransferAPI;
Expand Down Expand Up @@ -149,7 +147,6 @@ export class LCDClient {
this.gov = new GovAPI(this.apiRequester);
this.group = new GroupAPI(this.apiRequester);
this.ibc = new IbcAPI(this.apiRequester);
this.ibcFetchprice = new IbcFetchpriceAPI(this.apiRequester);
this.ibcHooks = new IbcHooksAPI(this.apiRequester);
this.ibcNft = new IbcNftAPI(this.apiRequester);
this.ibcTransfer = new IbcTransferAPI(this.apiRequester);
Expand Down
16 changes: 0 additions & 16 deletions src/client/lcd/api/IbcFetchpriceAPI.ts

This file was deleted.

16 changes: 8 additions & 8 deletions src/client/lcd/api/IbcPermAPI.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { BaseAPI } from './BaseAPI';
import { APIParams, Pagination, PaginationOptions } from '../APIRequester';

export interface PermissionedRelayer {
export interface PermissionedRelayers {
port_id: string;
channel_id: string;
relayer: string;
relayers: string[];
}

export class IbcPermAPI extends BaseAPI {
public async relayers(
params: Partial<PaginationOptions & APIParams> = {}
): Promise<[PermissionedRelayer[], Pagination]> {
): Promise<[PermissionedRelayers[], Pagination]> {
return this.c
.get<{
permissioned_relayers: PermissionedRelayer[];
permissioned_relayers: PermissionedRelayers[];
pagination: Pagination;
}>(`/ibc/apps/perm/v1/relayers`, params)
.then(d => [d.permissioned_relayers, d.pagination]);
}

public async relayer(
public async relayersByChannel(
port_id: string,
channel_id: string
): Promise<PermissionedRelayer> {
): Promise<PermissionedRelayers> {
return this.c
.get<{ permissioned_relayer: PermissionedRelayer }>(
.get<{ permissioned_relayers: PermissionedRelayers }>(
`/ibc/apps/perm/v1/relayers/${port_id}/${channel_id}`
)
.then(d => d.permissioned_relayer);
.then(d => d.permissioned_relayers);
}
}
1 change: 0 additions & 1 deletion src/client/lcd/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export * from './ForwardingAPI';
export * from './GovAPI';
export * from './GroupAPI';
export * from './IbcAPI';
export * from './IbcFetchpriceAPI';
export * from './IbcHooksAPI';
export * from './IbcNftAPI';
export * from './IbcTransferAPI';
Expand Down
51 changes: 10 additions & 41 deletions src/core/Msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,16 @@ import {
MsgRegisterCounterpartyPayee,
MsgRegisterPayee,
} from './ibc/applications/fee';
import {
IbcFetchpriceMsg,
MsgActivate,
MsgDeactivate,
MsgUpdateIbcFetchpriceParams,
} from './ibc/applications/fetchprice';
import { IbcHooksMsg, MsgUpdateACL, MsgUpdateIbcHooksParams } from './ibchooks';
import {
IbcNftMsg,
MsgNftTransfer,
MsgUpdateIbcNftParams,
} from './ibc/applications/nft-transfer';
import { IbcPermMsg, MsgSetPermissionedRelayer } from './ibc/applications/perm';
import {
IbcPermMsg,
MsgSetPermissionedRelayers,
} from './ibc/applications/perm';
import {
IbcTransferMsg,
MsgTransfer,
Expand Down Expand Up @@ -238,7 +235,6 @@ export type Msg =
| GovMsg
| GroupMsg
| IbcFeeMsg
| IbcFetchpriceMsg
| IbcHooksMsg
| IbcNftMsg
| IbcPermMsg
Expand Down Expand Up @@ -274,7 +270,6 @@ export namespace Msg {
| ForwardingMsg.Amino
| GovMsg.Amino
| GroupMsg.Amino
| IbcFetchpriceMsg.Amino
| IbcHooksMsg.Amino
| IbcNftMsg.Amino
| IbcPermMsg.Amino
Expand Down Expand Up @@ -308,7 +303,6 @@ export namespace Msg {
| GovMsg.Data
| GroupMsg.Data
| IbcFeeMsg.Data
| IbcFetchpriceMsg.Data
| IbcHooksMsg.Data
| IbcNftMsg.Data
| IbcPermMsg.Data
Expand Down Expand Up @@ -345,7 +339,6 @@ export namespace Msg {
| GovMsg.Proto
| GroupMsg.Proto
| IbcFeeMsg.Proto
| IbcFetchpriceMsg.Proto
| IbcHooksMsg.Proto
| IbcNftMsg.Proto
| IbcPermMsg.Proto
Expand Down Expand Up @@ -498,14 +491,6 @@ export namespace Msg {
case 'cosmos-sdk/group/MsgVote':
return MsgGroupVote.fromAmino(data);

// ibc-fetchprice
case 'fetchprice/MsgActivate':
return MsgActivate.fromAmino(data);
case 'fetchprice/MsgDeactivate':
return MsgDeactivate.fromAmino(data);
case 'fetchprice/MsgUpdateParams':
return MsgUpdateIbcFetchpriceParams.fromAmino(data);

// ibc-hooks
case 'ibchooks/MsgUpdateACL':
return MsgUpdateACL.fromAmino(data);
Expand All @@ -519,8 +504,8 @@ export namespace Msg {
return MsgUpdateIbcNftParams.fromAmino(data);

// ibc-perm
case 'perm/MsgSetPermissionedRelayer':
return MsgSetPermissionedRelayer.fromAmino(data);
case 'perm/MsgSetPermissionedRelayers':
return MsgSetPermissionedRelayers.fromAmino(data);

// ibc-transfer
case 'cosmos-sdk/MsgTransfer':
Expand Down Expand Up @@ -854,14 +839,6 @@ export namespace Msg {
case '/ibc.applications.fee.v1.MsgRegisterPayee':
return MsgRegisterPayee.fromData(data);

// ibc-fetchprice
case '/ibc.applications.fetchprice.v1.MsgActivate':
return MsgActivate.fromData(data);
case '/ibc.applications.fetchprice.v1.MsgDeactivate':
return MsgDeactivate.fromData(data);
case '/ibc.applications.fetchprice.v1.MsgUpdateParams':
return MsgUpdateIbcFetchpriceParams.fromData(data);

// ibc-hooks
case '/initia.ibchooks.v1.MsgUpdateACL':
return MsgUpdateACL.fromData(data);
Expand All @@ -875,8 +852,8 @@ export namespace Msg {
return MsgUpdateIbcNftParams.fromData(data);

// ibc-perm
case '/ibc.applications.perm.v1.MsgSetPermissionedRelayer':
return MsgSetPermissionedRelayer.fromData(data);
case '/ibc.applications.perm.v1.MsgSetPermissionedRelayers':
return MsgSetPermissionedRelayers.fromData(data);

// ibc-transfer
case '/ibc.applications.transfer.v1.MsgTransfer':
Expand Down Expand Up @@ -1267,14 +1244,6 @@ export namespace Msg {
case '/ibc.applications.fee.v1.MsgRegisterPayee':
return MsgRegisterPayee.unpackAny(proto);

// ibc-fetchprice
case '/ibc.applications.fetchprice.v1.MsgActivate':
return MsgActivate.unpackAny(proto);
case '/ibc.applications.fetchprice.v1.MsgDeactivate':
return MsgDeactivate.unpackAny(proto);
case '/ibc.applications.fetchprice.v1.MsgUpdateParams':
return MsgUpdateIbcFetchpriceParams.unpackAny(proto);

// ibc-hooks
case '/initia.ibchooks.v1.MsgUpdateACL':
return MsgUpdateACL.unpackAny(proto);
Expand All @@ -1288,8 +1257,8 @@ export namespace Msg {
return MsgUpdateIbcNftParams.unpackAny(proto);

// ibc-perm
case '/ibc.applications.perm.v1.MsgSetPermissionedRelayer':
return MsgSetPermissionedRelayer.unpackAny(proto);
case '/ibc.applications.perm.v1.MsgSetPermissionedRelayers':
return MsgSetPermissionedRelayers.unpackAny(proto);

// ibc-transfer
case '/ibc.applications.transfer.v1.MsgTransfer':
Expand Down
95 changes: 0 additions & 95 deletions src/core/ibc/applications/fetchprice/IbcFetchpriceParams.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/core/ibc/applications/fetchprice/index.ts

This file was deleted.

Loading

0 comments on commit c284638

Please sign in to comment.