Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl interface #71

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@
"cwd": "${workspaceFolder}/libs/interchainjs",
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests in Interchainjs authz",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--config",
"./jest.starship.config.js",
"--verbose",
"--bail",
"starship/__tests__/authz.test.ts"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/libs/interchainjs",
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion libs/injective-react/src/binary.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/[email protected].3
* This file and any referenced files were automatically generated by @cosmology/[email protected].7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
Expand Down
27 changes: 15 additions & 12 deletions libs/injective-react/src/cosmos/auth/v1beta1/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Any, AnyAmino } from "../../../google/protobuf/any";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers";
import { GlobalDecoderRegistry } from "../../../registry";
import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers";
/**
* BaseAccount defines a base account type. It contains all the necessary fields
* for basic account functionality. Any custom account type should extend this
Expand Down Expand Up @@ -222,10 +222,12 @@ export const BaseAccount = {
typeUrl: "/cosmos.auth.v1beta1.BaseAccount",
value: BaseAccount.encode(message).finish()
};
},
registerTypeUrl() {
GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount);
GlobalDecoderRegistry.registerAminoProtoMapping(BaseAccount.aminoType, BaseAccount.typeUrl);
}
};
GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount);
GlobalDecoderRegistry.registerAminoProtoMapping(BaseAccount.aminoType, BaseAccount.typeUrl);
function createBaseModuleAccount(): ModuleAccount {
return {
baseAccount: undefined,
Expand Down Expand Up @@ -326,10 +328,13 @@ export const ModuleAccount = {
typeUrl: "/cosmos.auth.v1beta1.ModuleAccount",
value: ModuleAccount.encode(message).finish()
};
},
registerTypeUrl() {
GlobalDecoderRegistry.register(ModuleAccount.typeUrl, ModuleAccount);
GlobalDecoderRegistry.registerAminoProtoMapping(ModuleAccount.aminoType, ModuleAccount.typeUrl);
BaseAccount.registerTypeUrl();
}
};
GlobalDecoderRegistry.register(ModuleAccount.typeUrl, ModuleAccount);
GlobalDecoderRegistry.registerAminoProtoMapping(ModuleAccount.aminoType, ModuleAccount.typeUrl);
function createBaseModuleCredential(): ModuleCredential {
return {
moduleName: "",
Expand Down Expand Up @@ -418,10 +423,9 @@ export const ModuleCredential = {
typeUrl: "/cosmos.auth.v1beta1.ModuleCredential",
value: ModuleCredential.encode(message).finish()
};
}
},
registerTypeUrl() {}
};
GlobalDecoderRegistry.register(ModuleCredential.typeUrl, ModuleCredential);
GlobalDecoderRegistry.registerAminoProtoMapping(ModuleCredential.aminoType, ModuleCredential.typeUrl);
function createBaseParams(): Params {
return {
maxMemoCharacters: BigInt(0),
Expand Down Expand Up @@ -544,7 +548,6 @@ export const Params = {
typeUrl: "/cosmos.auth.v1beta1.Params",
value: Params.encode(message).finish()
};
}
};
GlobalDecoderRegistry.register(Params.typeUrl, Params);
GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl);
},
registerTypeUrl() {}
};
30 changes: 20 additions & 10 deletions libs/injective-react/src/cosmos/auth/v1beta1/query.rpc.func.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery<Qu
decode: QueryAccountsResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "Accounts",
clientResolver
clientResolver,
deps: [QueryAccountsRequest, QueryAccountsResponse]
});
export const useGetAccounts = buildUseQuery<QueryAccountsRequest, QueryAccountsResponse>({
builderQueryFn: createGetAccounts,
Expand All @@ -17,7 +18,8 @@ export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery<Que
decode: QueryAccountResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "Account",
clientResolver
clientResolver,
deps: [QueryAccountRequest, QueryAccountResponse]
});
export const useGetAccount = buildUseQuery<QueryAccountRequest, QueryAccountResponse>({
builderQueryFn: createGetAccount,
Expand All @@ -28,7 +30,8 @@ export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => bui
decode: QueryAccountAddressByIDResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "AccountAddressByID",
clientResolver
clientResolver,
deps: [QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse]
});
export const useGetAccountAddressByID = buildUseQuery<QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse>({
builderQueryFn: createGetAccountAddressByID,
Expand All @@ -39,7 +42,8 @@ export const createGetParams = (clientResolver?: RpcResolver) => buildQuery<Quer
decode: QueryParamsResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "Params",
clientResolver
clientResolver,
deps: [QueryParamsRequest, QueryParamsResponse]
});
export const useGetParams = buildUseQuery<QueryParamsRequest, QueryParamsResponse>({
builderQueryFn: createGetParams,
Expand All @@ -50,7 +54,8 @@ export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQu
decode: QueryModuleAccountsResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "ModuleAccounts",
clientResolver
clientResolver,
deps: [QueryModuleAccountsRequest, QueryModuleAccountsResponse]
});
export const useGetModuleAccounts = buildUseQuery<QueryModuleAccountsRequest, QueryModuleAccountsResponse>({
builderQueryFn: createGetModuleAccounts,
Expand All @@ -61,7 +66,8 @@ export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => bu
decode: QueryModuleAccountByNameResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "ModuleAccountByName",
clientResolver
clientResolver,
deps: [QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse]
});
export const useGetModuleAccountByName = buildUseQuery<QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse>({
builderQueryFn: createGetModuleAccountByName,
Expand All @@ -72,7 +78,8 @@ export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuer
decode: Bech32PrefixResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "Bech32Prefix",
clientResolver
clientResolver,
deps: [Bech32PrefixRequest, Bech32PrefixResponse]
});
export const useGetBech32Prefix = buildUseQuery<Bech32PrefixRequest, Bech32PrefixResponse>({
builderQueryFn: createGetBech32Prefix,
Expand All @@ -83,7 +90,8 @@ export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => b
decode: AddressBytesToStringResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "AddressBytesToString",
clientResolver
clientResolver,
deps: [AddressBytesToStringRequest, AddressBytesToStringResponse]
});
export const useGetAddressBytesToString = buildUseQuery<AddressBytesToStringRequest, AddressBytesToStringResponse>({
builderQueryFn: createGetAddressBytesToString,
Expand All @@ -94,7 +102,8 @@ export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => b
decode: AddressStringToBytesResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "AddressStringToBytes",
clientResolver
clientResolver,
deps: [AddressStringToBytesRequest, AddressStringToBytesResponse]
});
export const useGetAddressStringToBytes = buildUseQuery<AddressStringToBytesRequest, AddressStringToBytesResponse>({
builderQueryFn: createGetAddressStringToBytes,
Expand All @@ -105,7 +114,8 @@ export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery
decode: QueryAccountInfoResponse.decode,
service: "cosmos.auth.v1beta1.Query",
method: "AccountInfo",
clientResolver
clientResolver,
deps: [QueryAccountInfoRequest, QueryAccountInfoResponse]
});
export const useGetAccountInfo = buildUseQuery<QueryAccountInfoRequest, QueryAccountInfoResponse>({
builderQueryFn: createGetAccountInfo,
Expand Down
Loading
Loading