diff --git a/packages/sdk-ts/package.json b/packages/sdk-ts/package.json index 779477a2c..21f07eb3d 100644 --- a/packages/sdk-ts/package.json +++ b/packages/sdk-ts/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/sdk-ts", "description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.", - "version": "1.14.19", + "version": "1.14.20-alpha.0", "sideEffects": false, "license": "Apache-2.0", "author": { @@ -39,7 +39,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@ethersproject/bytes": "^5.7.0", - "@injectivelabs/core-proto-ts": "1.13.3", + "@injectivelabs/core-proto-ts": "1.13.3-dev.0", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/grpc-web": "^0.0.1", "@injectivelabs/grpc-web-node-http-transport": "^0.0.2", diff --git a/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi._ts b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi._ts new file mode 100644 index 000000000..e23593a19 --- /dev/null +++ b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi._ts @@ -0,0 +1,215 @@ +import { + GrpcUnaryRequestException, + UnspecifiedErrorCode, +} from '@injectivelabs/exceptions' +import { InjectivePermissionsV1Beta1Query } from '@injectivelabs/core-proto-ts' +import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js' +import { ChainGrpcPermissionsTransformer } from '../transformers/index.js' +import { ChainModule } from '../types/index.js' + +/** + * @category Chain Grpc API + */ +export class ChainGrpcPermissionsApi extends BaseGrpcConsumer { + protected module: string = ChainModule.Permissions + + protected client: InjectivePermissionsV1Beta1Query.QueryClientImpl + + constructor(endpoint: string) { + super(endpoint) + + this.client = new InjectivePermissionsV1Beta1Query.QueryClientImpl( + this.getGrpcWebImpl(endpoint), + ) + } + + async fetchAddressesByRole({ denom, role }: { denom: string; role: string }) { + const request = + InjectivePermissionsV1Beta1Query.QueryAddressesByRoleRequest.create() + + request.denom = denom + request.role = role + + try { + const response = + await this.retry( + () => this.client.AddressesByRole(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.addressesByRolesResponseToAddressesByRoles( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'AddressesByRole', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'AddressesByRole', + }) + } + } + + async fetchAddressRoles({ + address, + denom, + }: { + address: string + denom: string + }) { + const request = + InjectivePermissionsV1Beta1Query.QueryAddressRolesRequest.create() + + request.address = address + request.denom = denom + + try { + const response = + await this.retry( + () => this.client.AddressRoles(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.addressRolesResponseToAddressRoles( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'AddressRoles', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'AddressRoles', + }) + } + } + + async fetchAllNamespaces() { + const request = + InjectivePermissionsV1Beta1Query.QueryAllNamespacesRequest.create() + + try { + const response = + await this.retry( + () => this.client.AllNamespaces(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.allNamespacesResponseToAllNamespaces( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'AllNamespaces', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'AllNamespaces', + }) + } + } + + async fetchModuleParams() { + const request = InjectivePermissionsV1Beta1Query.QueryParamsRequest.create() + + try { + const response = + await this.retry( + () => this.client.Params(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.moduleParamsResponseToModuleParams( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'Params', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'Params', + }) + } + } + + async fetchNamespaceByDenom({ + denom, + includeRoles, + }: { + denom: string + includeRoles: boolean + }) { + const request = + InjectivePermissionsV1Beta1Query.QueryNamespaceByDenomRequest.create() + + request.denom = denom + request.includeRoles = includeRoles + + try { + const response = + await this.retry( + () => this.client.NamespaceByDenom(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.namespaceByDenomResponceToNamespaceByDenom( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'NamespaceByDenom', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'NamespaceByDenom', + }) + } + } + + async fetchVouchersForAddress({ address }: { address: string }) { + const request = + InjectivePermissionsV1Beta1Query.QueryVouchersForAddressRequest.create() + + request.address = address + + try { + const response = + await this.retry( + () => this.client.VouchersForAddress(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.vouchersForAddressResponseToVouchersForAddress( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'VouchersForAddress', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'VouchersForAddress', + }) + } + } +} diff --git a/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.spec.ts b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.spec._ts similarity index 100% rename from packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.spec.ts rename to packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.spec._ts diff --git a/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.ts b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.ts index e23593a19..a5542d34b 100644 --- a/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.ts +++ b/packages/sdk-ts/src/client/chain/grpc/ChainGrpcPermissionsApi.ts @@ -23,192 +23,357 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer { ) } - async fetchAddressesByRole({ denom, role }: { denom: string; role: string }) { + async fetchParams() { + const request = InjectivePermissionsV1Beta1Query.QueryParamsRequest.create() + + try { + const response = + await this.retry( + () => this.client.Params(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.paramsResponseToParams(response) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'Params', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'Params', + }) + } + } + + async fetchNamespaces() { const request = - InjectivePermissionsV1Beta1Query.QueryAddressesByRoleRequest.create() + InjectivePermissionsV1Beta1Query.QueryNamespacesRequest.create() + + try { + const response = + await this.retry( + () => this.client.Namespaces(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.namespacesResponseToNamespaces( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'Namespaces', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'Namespaces', + }) + } + } + + async fetchNamespace(denom: string) { + const request = + InjectivePermissionsV1Beta1Query.QueryNamespaceRequest.create() request.denom = denom + + try { + const response = + await this.retry( + () => this.client.Namespace(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.namespaceResponseToNamespace( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'Namespace', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'Namespace', + }) + } + } + + async fetchNamespaceDenoms(_namespace: string) { + const request = + InjectivePermissionsV1Beta1Query.QueryNamespaceDenomsRequest.create() + + // request.namespace = namespace + + try { + const response = + await this.retry( + () => this.client.NamespaceDenoms(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.namespaceDenomsResponseToNamespaceDenoms( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'Namespace', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'Namespace', + }) + } + } + + async fetchActorsByRole(role: string, denom: string) { + const request = + InjectivePermissionsV1Beta1Query.QueryActorsByRoleRequest.create() + request.role = role + request.denom = denom try { const response = - await this.retry( - () => this.client.AddressesByRole(request, this.metadata), + await this.retry( + () => this.client.ActorsByRole(request, this.metadata), ) - return ChainGrpcPermissionsTransformer.addressesByRolesResponseToAddressesByRoles( + return ChainGrpcPermissionsTransformer.actorsByRoleResponseToActorsByRole( response, ) } catch (e: unknown) { if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, - context: 'AddressesByRole', + context: 'ActorsByRole', }) } throw new GrpcUnaryRequestException(e as Error, { code: UnspecifiedErrorCode, - context: 'AddressesByRole', + context: 'ActorsByRole', }) } } - async fetchAddressRoles({ - address, - denom, - }: { - address: string - denom: string - }) { + async fetchRolesByActor(actor: string, denom: string) { const request = - InjectivePermissionsV1Beta1Query.QueryAddressRolesRequest.create() + InjectivePermissionsV1Beta1Query.QueryRolesByActorRequest.create() - request.address = address + request.actor = actor request.denom = denom try { const response = - await this.retry( - () => this.client.AddressRoles(request, this.metadata), + await this.retry( + () => this.client.RolesByActor(request, this.metadata), ) - return ChainGrpcPermissionsTransformer.addressRolesResponseToAddressRoles( + return ChainGrpcPermissionsTransformer.rolesByActorResponseToRolesByActor( response, ) } catch (e: unknown) { if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, - context: 'AddressRoles', + context: 'RolesByActor', }) } throw new GrpcUnaryRequestException(e as Error, { code: UnspecifiedErrorCode, - context: 'AddressRoles', + context: 'RolesByActor', }) } } - async fetchAllNamespaces() { + async fetchRoleManagers(denom: string) { const request = - InjectivePermissionsV1Beta1Query.QueryAllNamespacesRequest.create() + InjectivePermissionsV1Beta1Query.QueryRoleManagersRequest.create() + + request.denom = denom try { const response = - await this.retry( - () => this.client.AllNamespaces(request, this.metadata), + await this.retry( + () => this.client.RoleManagers(request, this.metadata), ) - return ChainGrpcPermissionsTransformer.allNamespacesResponseToAllNamespaces( + return ChainGrpcPermissionsTransformer.roleManagersResponseToRoleManagers( response, ) } catch (e: unknown) { if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, - context: 'AllNamespaces', + context: 'RoleManagers', }) } throw new GrpcUnaryRequestException(e as Error, { code: UnspecifiedErrorCode, - context: 'AllNamespaces', + context: 'RoleManagers', }) } } - async fetchModuleParams() { - const request = InjectivePermissionsV1Beta1Query.QueryParamsRequest.create() + async fetchRoleManager(manager: string, denom: string) { + const request = + InjectivePermissionsV1Beta1Query.QueryRoleManagerRequest.create() + + request.manager = manager + request.denom = denom try { const response = - await this.retry( - () => this.client.Params(request, this.metadata), + await this.retry( + () => this.client.RoleManager(request, this.metadata), ) - return ChainGrpcPermissionsTransformer.moduleParamsResponseToModuleParams( + return ChainGrpcPermissionsTransformer.roleManagerResponseToRoleManager( response, ) } catch (e: unknown) { if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, - context: 'Params', + context: 'RoleManager', }) } throw new GrpcUnaryRequestException(e as Error, { code: UnspecifiedErrorCode, - context: 'Params', + context: 'RoleManager', + }) + } + } + + async fetchPolicyStatuses(denom: string) { + const request = + InjectivePermissionsV1Beta1Query.QueryPolicyStatusesRequest.create() + + request.denom = denom + + try { + const response = + await this.retry( + () => this.client.PolicyStatuses(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.policyStatusesResponseToPolicyStatuses( + response, + ) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'PolicyStatuses', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'PolicyStatuses', }) } } - async fetchNamespaceByDenom({ - denom, - includeRoles, - }: { - denom: string - includeRoles: boolean - }) { + async fetchPolicyManagerCapabilities(denom: string) { const request = - InjectivePermissionsV1Beta1Query.QueryNamespaceByDenomRequest.create() + InjectivePermissionsV1Beta1Query.QueryPolicyManagerCapabilitiesRequest.create() request.denom = denom - request.includeRoles = includeRoles try { const response = - await this.retry( - () => this.client.NamespaceByDenom(request, this.metadata), + await this.retry( + () => this.client.PolicyManagerCapabilities(request, this.metadata), ) - return ChainGrpcPermissionsTransformer.namespaceByDenomResponceToNamespaceByDenom( + return ChainGrpcPermissionsTransformer.policyManagerCapabilitiesResponseToPolicyManagerCapabilities( response, ) } catch (e: unknown) { if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, - context: 'NamespaceByDenom', + context: 'PolicyManagerCapabilities', }) } throw new GrpcUnaryRequestException(e as Error, { code: UnspecifiedErrorCode, - context: 'NamespaceByDenom', + context: 'PolicyManagerCapabilities', }) } } - async fetchVouchersForAddress({ address }: { address: string }) { + async fetchVoucher(denom: string, address: string) { const request = - InjectivePermissionsV1Beta1Query.QueryVouchersForAddressRequest.create() + InjectivePermissionsV1Beta1Query.QueryVoucherRequest.create() + request.denom = denom request.address = address try { const response = - await this.retry( - () => this.client.VouchersForAddress(request, this.metadata), + await this.retry( + () => this.client.Voucher(request, this.metadata), + ) + + return ChainGrpcPermissionsTransformer.voucherResponseToVoucher(response) + } catch (e: unknown) { + if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { + throw new GrpcUnaryRequestException(new Error(e.toString()), { + code: e.code, + context: 'Voucher', + }) + } + + throw new GrpcUnaryRequestException(e as Error, { + code: UnspecifiedErrorCode, + context: 'Voucher', + }) + } + } + + async fetchVouchers(denom: string) { + const request = + InjectivePermissionsV1Beta1Query.QueryVouchersRequest.create() + + request.denom = denom + + try { + const response = + await this.retry( + () => this.client.Vouchers(request, this.metadata), ) - return ChainGrpcPermissionsTransformer.vouchersForAddressResponseToVouchersForAddress( + return ChainGrpcPermissionsTransformer.vouchersResponseToVouchers( response, ) } catch (e: unknown) { if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) { throw new GrpcUnaryRequestException(new Error(e.toString()), { code: e.code, - context: 'VouchersForAddress', + context: 'Vouchers', }) } throw new GrpcUnaryRequestException(e as Error, { code: UnspecifiedErrorCode, - context: 'VouchersForAddress', + context: 'Vouchers', }) } } diff --git a/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer._ts b/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer._ts new file mode 100644 index 000000000..9564b6cd9 --- /dev/null +++ b/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer._ts @@ -0,0 +1,81 @@ +import { + Namespace, + PermissionsModuleParams, + GrpcPermissionsNamespace, +} from '../types/permissions.js' +import { InjectivePermissionsV1Beta1Query } from '@injectivelabs/core-proto-ts' + +/** + * @category Chain Grpc Transformer + */ +export class ChainGrpcPermissionsTransformer { + static moduleParamsResponseToModuleParams( + response: InjectivePermissionsV1Beta1Query.QueryParamsResponse, + ): PermissionsModuleParams { + const params = response.params! + + return { + wasmHookQueryMaxGas: params.wasmHookQueryMaxGas, + } + } + + static grpcNamespaceToNamespace( + grpcNamespace: GrpcPermissionsNamespace, + ): Namespace { + return { + denom: grpcNamespace.denom, + wasmHook: grpcNamespace.wasmHook, + mintsPaused: grpcNamespace.mintsPaused, + sendsPaused: grpcNamespace.sendsPaused, + burnsPaused: grpcNamespace.burnsPaused, + rolePermissions: grpcNamespace.rolePermissions, + addressRoles: grpcNamespace.addressRoles, + } + } + + static addressRolesResponseToAddressRoles( + response: InjectivePermissionsV1Beta1Query.QueryAddressRolesResponse, + ) { + return response.roles.map((role) => { + return { + roles: role, + } + }) + } + + static addressesByRolesResponseToAddressesByRoles( + response: InjectivePermissionsV1Beta1Query.QueryAddressesByRoleResponse, + ) { + return response.addresses.map((address) => { + return { + addresses: address, + } + }) + } + + static allNamespacesResponseToAllNamespaces( + response: InjectivePermissionsV1Beta1Query.QueryAllNamespacesResponse, + ) { + return response.namespaces.map((namespace) => { + ChainGrpcPermissionsTransformer.grpcNamespaceToNamespace(namespace) + }) + } + + static namespaceByDenomResponceToNamespaceByDenom( + response: InjectivePermissionsV1Beta1Query.QueryNamespaceByDenomResponse, + ) { + return ChainGrpcPermissionsTransformer.grpcNamespaceToNamespace( + response.namespace!, + ) + } + + static vouchersForAddressResponseToVouchersForAddress( + response: InjectivePermissionsV1Beta1Query.QueryVouchersForAddressResponse, + ) { + return response.vouchers.map((voucher) => { + return { + vouchers: voucher, + } + }) + } +} diff --git a/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer.ts b/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer.ts index 9564b6cd9..3e7c97508 100644 --- a/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer.ts +++ b/packages/sdk-ts/src/client/chain/transformers/ChainGrpcPermissionsTransformer.ts @@ -1,7 +1,11 @@ import { + Voucher, Namespace, + RoleManager, + PolicyStatus, + AddressVoucher, + PolicyManagerCapability, PermissionsModuleParams, - GrpcPermissionsNamespace, } from '../types/permissions.js' import { InjectivePermissionsV1Beta1Query } from '@injectivelabs/core-proto-ts' @@ -9,73 +13,77 @@ import { InjectivePermissionsV1Beta1Query } from '@injectivelabs/core-proto-ts' * @category Chain Grpc Transformer */ export class ChainGrpcPermissionsTransformer { - static moduleParamsResponseToModuleParams( + static paramsResponseToParams( response: InjectivePermissionsV1Beta1Query.QueryParamsResponse, ): PermissionsModuleParams { - const params = response.params! - return { - wasmHookQueryMaxGas: params.wasmHookQueryMaxGas, + wasmHookQueryMaxGas: response.params?.wasmHookQueryMaxGas || '0', } } - static grpcNamespaceToNamespace( - grpcNamespace: GrpcPermissionsNamespace, + static namespacesResponseToNamespaces( + response: InjectivePermissionsV1Beta1Query.QueryNamespacesResponse, + ): Namespace[] { + return response.namespaces + } + + static namespaceResponseToNamespace( + response: InjectivePermissionsV1Beta1Query.QueryNamespaceResponse, ): Namespace { - return { - denom: grpcNamespace.denom, - wasmHook: grpcNamespace.wasmHook, - mintsPaused: grpcNamespace.mintsPaused, - sendsPaused: grpcNamespace.sendsPaused, - burnsPaused: grpcNamespace.burnsPaused, - rolePermissions: grpcNamespace.rolePermissions, - addressRoles: grpcNamespace.addressRoles, - } + return response.namespace! + } + + static namespaceDenomsResponseToNamespaceDenoms( + response: InjectivePermissionsV1Beta1Query.QueryNamespaceDenomsResponse, + ): string[] { + return response.denoms + } + + static actorsByRoleResponseToActorsByRole( + response: InjectivePermissionsV1Beta1Query.QueryActorsByRoleResponse, + ): string[] { + return response.actors + } + + static rolesByActorResponseToRolesByActor( + response: InjectivePermissionsV1Beta1Query.QueryRolesByActorResponse, + ): string[] { + return response.roles + } + + static roleManagersResponseToRoleManagers( + response: InjectivePermissionsV1Beta1Query.QueryRoleManagersResponse, + ): RoleManager[] { + return response.roleManagers } - static addressRolesResponseToAddressRoles( - response: InjectivePermissionsV1Beta1Query.QueryAddressRolesResponse, - ) { - return response.roles.map((role) => { - return { - roles: role, - } - }) + static roleManagerResponseToRoleManager( + response: InjectivePermissionsV1Beta1Query.QueryRoleManagerResponse, + ): RoleManager { + return response.roleManager! } - static addressesByRolesResponseToAddressesByRoles( - response: InjectivePermissionsV1Beta1Query.QueryAddressesByRoleResponse, - ) { - return response.addresses.map((address) => { - return { - addresses: address, - } - }) + static policyStatusesResponseToPolicyStatuses( + response: InjectivePermissionsV1Beta1Query.QueryPolicyStatusesResponse, + ): PolicyStatus[] { + return response.policyStatuses } - static allNamespacesResponseToAllNamespaces( - response: InjectivePermissionsV1Beta1Query.QueryAllNamespacesResponse, - ) { - return response.namespaces.map((namespace) => { - ChainGrpcPermissionsTransformer.grpcNamespaceToNamespace(namespace) - }) + static policyManagerCapabilitiesResponseToPolicyManagerCapabilities( + response: InjectivePermissionsV1Beta1Query.QueryPolicyManagerCapabilitiesResponse, + ): PolicyManagerCapability[] { + return response.policyManagerCapabilities } - static namespaceByDenomResponceToNamespaceByDenom( - response: InjectivePermissionsV1Beta1Query.QueryNamespaceByDenomResponse, - ) { - return ChainGrpcPermissionsTransformer.grpcNamespaceToNamespace( - response.namespace!, - ) + static vouchersResponseToVouchers( + response: InjectivePermissionsV1Beta1Query.QueryVouchersResponse, + ): AddressVoucher[] { + return response.vouchers } - static vouchersForAddressResponseToVouchersForAddress( - response: InjectivePermissionsV1Beta1Query.QueryVouchersForAddressResponse, - ) { - return response.vouchers.map((voucher) => { - return { - vouchers: voucher, - } - }) + static voucherResponseToVoucher( + response: InjectivePermissionsV1Beta1Query.QueryVoucherResponse, + ): Voucher { + return response.voucher } } diff --git a/packages/sdk-ts/src/client/chain/types/permissions.ts b/packages/sdk-ts/src/client/chain/types/permissions.ts index 16a727c5a..df68fa1ee 100644 --- a/packages/sdk-ts/src/client/chain/types/permissions.ts +++ b/packages/sdk-ts/src/client/chain/types/permissions.ts @@ -4,52 +4,45 @@ import { } from '@injectivelabs/core-proto-ts' import { Coin } from '@injectivelabs/ts-types' -export interface Namespace { - denom: string - wasmHook: string - mintsPaused: boolean - sendsPaused: boolean - burnsPaused: boolean - rolePermissions: Role[] - addressRoles: AddressRoles[] -} +export type GrpcPermissionsNamespace = + InjectivePermissionsV1Beta1Permissions.Namespace +export type GrpcPermissionsRole = InjectivePermissionsV1Beta1Permissions.Role +export type GrpcPermissionsRoleIDs = + InjectivePermissionsV1Beta1Permissions.RoleIDs +export type GrpcPermissionsAddressVoucher = + InjectivePermissionsV1Beta1Permissions.AddressVoucher +export type GrpcPermissionVoucher = + InjectivePermissionsV1Beta1Permissions.Voucher +export type GrpcPermissionsParams = InjectivePermissionsV1Beta1Params.Params -export interface PermissionsModuleParams { - wasmHookQueryMaxGas: string +export interface Namespace + extends InjectivePermissionsV1Beta1Permissions.Namespace { + // } -export interface AddressRoles { - address: string - roles: string[] +export interface PermissionsModuleParams + extends InjectivePermissionsV1Beta1Params.Params { + // } -export interface Role { - role: string - permissions: number +export interface RoleManager + extends InjectivePermissionsV1Beta1Permissions.RoleManager { + // } -export interface RoleIDs { - roleIds: number[] +export interface PolicyStatus + extends InjectivePermissionsV1Beta1Permissions.PolicyStatus { + // } -export interface Voucher { - coins: Coin[] +export interface PolicyManagerCapability + extends InjectivePermissionsV1Beta1Permissions.PolicyManagerCapability { + // } -export interface AddressVoucher { - address: string - voucher?: Voucher +export interface AddressVoucher + extends InjectivePermissionsV1Beta1Permissions.AddressVoucher { + // } -export type GrpcPermissionsNamespace = - InjectivePermissionsV1Beta1Permissions.Namespace -export type GrpcPermissionsAddressRoles = - InjectivePermissionsV1Beta1Permissions.AddressRoles -export type GrpcPermissionsRole = InjectivePermissionsV1Beta1Permissions.Role -export type GrpcPermissionsRoleIDs = - InjectivePermissionsV1Beta1Permissions.RoleIDs -export type GrpcPermissionsAddressVoucher = - InjectivePermissionsV1Beta1Permissions.AddressVoucher -export type GrpcPermissionVoucher = - InjectivePermissionsV1Beta1Permissions.Voucher -export type GrpcPermissionsParams = InjectivePermissionsV1Beta1Params.Params +export type Voucher = Coin | undefined diff --git a/packages/sdk-ts/src/core/modules/msgs.ts b/packages/sdk-ts/src/core/modules/msgs.ts index f2da20dd9..2c05276b9 100644 --- a/packages/sdk-ts/src/core/modules/msgs.ts +++ b/packages/sdk-ts/src/core/modules/msgs.ts @@ -56,6 +56,10 @@ import MsgSignData from './exchange/msgs/MsgSignData.js' import MsgSetDenomMetadata from './tokenfactory/msgs/MsgSetDenomMetadata.js' import MsgExternalTransfer from './exchange/msgs/MsgExternalTransfer.js' import MsgLiquidatePosition from './exchange/msgs/MsgLiquidatePosition.js' +import MsgClaimVoucher from './permissions/msgs/MsgClaimVoucher.js' +import MsgCreateNamespace from './permissions/msgs/MsgCreateNamespace.js' +import MsgUpdateNamespace from './permissions/msgs/MsgUpdateNamespace.js' +import MsgUpdatePermissionParams from './permissions/msgs/MsgUpdateParams.js' import { MsgSubmitProposal } from './gov/index.js' /** @@ -121,6 +125,10 @@ export type Msgs = | MsgAdminUpdateBinaryOptionsMarket | MsgLiquidatePosition | MsgSignData + | MsgClaimVoucher + | MsgCreateNamespace + | MsgUpdateNamespace + | MsgUpdatePermissionParams /** * @category Messages diff --git a/packages/sdk-ts/src/core/modules/permissions/index.ts b/packages/sdk-ts/src/core/modules/permissions/index.ts index 9bb9e1bfb..f02ee3b75 100644 --- a/packages/sdk-ts/src/core/modules/permissions/index.ts +++ b/packages/sdk-ts/src/core/modules/permissions/index.ts @@ -1,17 +1,17 @@ import MsgClaimVoucher from './msgs/MsgClaimVoucher.js' import MsgCreateNamespace from './msgs/MsgCreateNamespace.js' -import MsgDeleteNamespace from './msgs/MsgDeleteNamespace.js' -import MsgRevokeNamespaceRoles from './msgs/MsgRevokeNamespaceRoles.js' +// import MsgDeleteNamespace from './msgs/MsgDeleteNamespace._ts' +// import MsgRevokeNamespaceRoles from './msgs/MsgRevokeNamespaceRoles._ts' import MsgUpdateNamespace from './msgs/MsgUpdateNamespace.js' -import MsgUpdateNamespaceRoles from './msgs/MsgUpdateNamespaceRoles.js' +// import MsgUpdateNamespaceRoles from './msgs/MsgUpdateNamespaceRoles._ts' import MsgUpdateParams from './msgs/MsgUpdateParams.js' export { MsgClaimVoucher, MsgCreateNamespace, - MsgDeleteNamespace, - MsgRevokeNamespaceRoles, + // MsgDeleteNamespace, + // MsgRevokeNamespaceRoles, MsgUpdateNamespace, - MsgUpdateNamespaceRoles, + // MsgUpdateNamespaceRoles, MsgUpdateParams, } diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgCreateNamespace.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgCreateNamespace.ts index 2dca6c013..fecb51419 100644 --- a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgCreateNamespace.ts +++ b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgCreateNamespace.ts @@ -1,19 +1,14 @@ import { MsgBase } from '../../MsgBase.js' import snakecaseKeys from 'snakecase-keys' -import { InjectivePermissionsV1Beta1Tx } from '@injectivelabs/core-proto-ts' +import { + InjectivePermissionsV1Beta1Tx, + InjectivePermissionsV1Beta1Permissions, +} from '@injectivelabs/core-proto-ts' export declare namespace MsgCreateNamespace { export interface Params { sender: string - namespace: { - denom: string - wasmHook: string - mintsPaused: boolean - sendsPaused: boolean - burnsPaused: boolean - rolePermissions: { role: string; permissions: number }[] - addressRoles: { address: string; roles: string[] }[] - } + namespace: InjectivePermissionsV1Beta1Permissions.Namespace } export type Proto = InjectivePermissionsV1Beta1Tx.MsgCreateNamespace diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace._ts similarity index 100% rename from packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.ts rename to packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace._ts diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.spec.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.spec._ts similarity index 95% rename from packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.spec.ts rename to packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.spec._ts index f6335b345..b7b1f2290 100644 --- a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.spec.ts +++ b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgDeleteNamespace.spec._ts @@ -1,5 +1,5 @@ import snakecaseKeys from 'snakecase-keys' -import MsgDeleteNamespace from './MsgDeleteNamespace.js' +import MsgDeleteNamespace from './MsgDeleteNamespace._ts' import { mockFactory } from '@injectivelabs/test-utils' const params: MsgDeleteNamespace['params'] = { diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles._ts similarity index 100% rename from packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.ts rename to packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles._ts diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.spec.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.spec._ts similarity index 95% rename from packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.spec.ts rename to packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.spec._ts index dbfe9a8f3..18b2abe7a 100644 --- a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.spec.ts +++ b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgRevokeNamespaceRoles.spec._ts @@ -1,5 +1,5 @@ import snakecaseKeys from 'snakecase-keys' -import MsgRevokeNamespaceRoles from './MsgRevokeNamespaceRoles.js' +import MsgRevokeNamespaceRoles from './MsgRevokeNamespaceRoles._ts' import { mockFactory } from '@injectivelabs/test-utils' const params: MsgRevokeNamespaceRoles['params'] = { diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespace.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespace.ts index 65517b284..2126c1901 100644 --- a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespace.ts +++ b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespace.ts @@ -1,23 +1,14 @@ import { MsgBase } from '../../MsgBase.js' import snakecaseKeys from 'snakecase-keys' -import { InjectivePermissionsV1Beta1Tx } from '@injectivelabs/core-proto-ts' +import { + InjectivePermissionsV1Beta1Tx, + InjectivePermissionsV1Beta1Permissions, +} from '@injectivelabs/core-proto-ts' export declare namespace MsgUpdateNamespace { export interface Params { sender: string - namespaceDenom: string - wasmHook: { - newValue: string - } - mintsPaused: { - newValue: boolean - } - sendsPaused: { - newValue: boolean - } - burnsPaused: { - newValue: boolean - } + namespace: Partial } export type Proto = InjectivePermissionsV1Beta1Tx.MsgUpdateNamespace @@ -38,19 +29,89 @@ export default class MsgUpdateNamespace extends MsgBase< const { params } = this const message = InjectivePermissionsV1Beta1Tx.MsgUpdateNamespace.create() + message.sender = params.sender - message.namespaceDenom = params.namespaceDenom - message.wasmHook = { - newValue: params.wasmHook.newValue, + + if (params.namespace.contractHook) { + const contractHook = + InjectivePermissionsV1Beta1Tx.MsgUpdateNamespace_SetContractHook.create() + contractHook.newValue = params.namespace.contractHook + + message.contractHook = contractHook } - message.mintsPaused = { - newValue: params.mintsPaused.newValue, + + if (params.namespace.roleManagers) { + const roleManagers = params.namespace.roleManagers.map((roleManager) => { + const manager = + InjectivePermissionsV1Beta1Permissions.RoleManager.create() + + manager.roles = roleManager.roles + manager.manager = roleManager.manager + + return manager + }) + + message.roleManagers = roleManagers } - message.sendsPaused = { - newValue: params.sendsPaused.newValue, + + if (params.namespace.rolePermissions) { + const permissions = params.namespace.rolePermissions.map( + (rolePermission) => { + const permission = + InjectivePermissionsV1Beta1Permissions.Role.create() + + permission.name = rolePermission.name + permission.permissions = rolePermission.permissions + permission.roleId = rolePermission.roleId + + return permission + }, + ) + + message.rolePermissions = permissions + } + + // /** policy statuses to update */ + // policyStatuses: PolicyStatus[]; + // /** policy manager capabilities to update */ + // policyManagerCapabilities: PolicyManagerCapability[]; + + if (params.namespace.policyStatuses) { + const policyStatuses = params.namespace.policyStatuses.map( + (policyStatus) => { + const policy = + InjectivePermissionsV1Beta1Permissions.PolicyStatus.create() + + policy.action = policyStatus.action + policy.isDisabled = policyStatus.isDisabled + policy.isSealed = policyStatus.isSealed + + return policy + }, + ) + + message.policyStatuses = policyStatuses } - message.burnsPaused = { - newValue: params.burnsPaused.newValue, + + if (params.namespace.policyManagerCapabilities) { + const policyManagerCapabilities = + params.namespace.policyManagerCapabilities.map((capability) => { + const policy = + InjectivePermissionsV1Beta1Permissions.PolicyManagerCapability.create() + + policy.action = capability.action + policy.canDisable = capability.canDisable + policy.canSeal = capability.canSeal + policy.manager = capability.manager + + return policy + }) + + message.policyManagerCapabilities = policyManagerCapabilities + } + + if (params.namespace.denom) { + message.denom = params.namespace.denom } return InjectivePermissionsV1Beta1Tx.MsgUpdateNamespace.fromPartial(message) diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles._ts similarity index 100% rename from packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles.ts rename to packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles._ts diff --git a/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles.spec.ts b/packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles.spec._ts similarity index 100% rename from packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles.spec.ts rename to packages/sdk-ts/src/core/modules/permissions/msgs/MsgUpdateNamespaceRoles.spec._ts diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts index 3d1b887f9..73a8c3eb5 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgBurn.ts @@ -8,6 +8,7 @@ import { export declare namespace MsgBurn { export interface Params { sender: string + burnFromAddress?: string amount: { amount: string denom: string @@ -38,6 +39,10 @@ export default class MsgBurn extends MsgBase { message.sender = params.sender message.amount = coin + if (params.burnFromAddress) { + message.burnFromAddress = params.burnFromAddress + } + return InjectiveTokenFactoryV1Beta1Tx.MsgBurn.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts index e79e8982e..039aee2ed 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgCreateDenom.ts @@ -9,6 +9,7 @@ export declare namespace MsgCreateDenom { decimals?: number name?: string symbol?: string + allowAdminBurn?: boolean } export type Proto = InjectiveTokenFactoryV1Beta1Tx.MsgCreateDenom @@ -36,6 +37,10 @@ export default class MsgCreateDenom extends MsgBase< message.symbol = params.symbol || '' message.decimals = params.decimals || 0 + if (params.allowAdminBurn !== undefined) { + message.allowAdminBurn = params.allowAdminBurn + } + return InjectiveTokenFactoryV1Beta1Tx.MsgCreateDenom.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts index 8222aaea3..0cdac776b 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgMint.ts @@ -8,6 +8,7 @@ import { export declare namespace MsgMint { export interface Params { sender: string + receiver?: string amount: { amount: string denom: string @@ -38,6 +39,10 @@ export default class MsgMint extends MsgBase { message.sender = params.sender message.amount = coin + if (params.receiver) { + message.receiver = params.receiver + } + return InjectiveTokenFactoryV1Beta1Tx.MsgMint.fromPartial(message) } diff --git a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts index 30bf66b81..dabb48b50 100644 --- a/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts +++ b/packages/sdk-ts/src/core/modules/tokenfactory/msgs/MsgSetDenomMetadata.ts @@ -9,6 +9,7 @@ export declare namespace MsgSetDenomMetadata { export interface Params { sender: string metadata: CosmosBankV1Beta1Bank.Metadata + adminBurnDisabled?: boolean } export type Proto = InjectiveTokenFactoryV1Beta1Tx.MsgSetDenomMetadata @@ -50,6 +51,14 @@ export default class MsgSetDenomMetadata extends MsgBase< const message = InjectiveTokenFactoryV1Beta1Tx.MsgSetDenomMetadata.create() + if (params.adminBurnDisabled !== undefined) { + const adminBurnDisabled = + InjectiveTokenFactoryV1Beta1Tx.MsgSetDenomMetadata_AdminBurnDisabled.create() + + adminBurnDisabled.shouldDisable = params.adminBurnDisabled + message.adminBurnDisabled = adminBurnDisabled + } + message.sender = params.sender message.metadata = metadata diff --git a/packages/wallet-ts/package.json b/packages/wallet-ts/package.json index f4ca6fd67..5889baee5 100644 --- a/packages/wallet-ts/package.json +++ b/packages/wallet-ts/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-ts", "description": "A convenient way to use and interact with different types of wallets on Injective.", - "version": "1.14.19", + "version": "1.14.20-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -41,7 +41,7 @@ "@ethereumjs/tx": "^4.1.1", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", "@keplr-wallet/cosmos": "^0.12.71", diff --git a/packages/wallets/wallet-base/package.json b/packages/wallets/wallet-base/package.json index c5bf173a8..2a0a3d874 100644 --- a/packages/wallets/wallet-base/package.json +++ b/packages/wallets/wallet-base/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-base", "description": "Base wallet strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -37,7 +37,7 @@ "@ethereumjs/tx": "^4.1.1", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", "alchemy-sdk": "^3.4.7", diff --git a/packages/wallets/wallet-core/package.json b/packages/wallets/wallet-core/package.json index e9a6c1b66..9f616c813 100644 --- a/packages/wallets/wallet-core/package.json +++ b/packages/wallets/wallet-core/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-core", "description": "Core wallet strategy", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -35,7 +35,7 @@ "dependencies": { "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", "eip1193-provider": "^1.0.1" diff --git a/packages/wallets/wallet-cosmos-strategy/package.json b/packages/wallets/wallet-cosmos-strategy/package.json index c2c4798e8..6a31161ee 100644 --- a/packages/wallets/wallet-cosmos-strategy/package.json +++ b/packages/wallets/wallet-cosmos-strategy/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-cosmos-strategy", "description": "Wallet Cosmos Strategy with instantiated wallets", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -37,13 +37,13 @@ "@ethereumjs/tx": "^4.1.1", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", - "@injectivelabs/wallet-core": "^0.0.6", - "@injectivelabs/wallet-cosmos": "^0.0.6", - "@injectivelabs/wallet-cosmostation": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", + "@injectivelabs/wallet-core": "^0.0.7-alpha.0", + "@injectivelabs/wallet-cosmos": "^0.0.7-alpha.0", + "@injectivelabs/wallet-cosmostation": "^0.0.7-alpha.0", "alchemy-sdk": "^3.4.7", "eip1193-provider": "^1.0.1", "eth-sig-util": "^3.0.1", diff --git a/packages/wallets/wallet-cosmos/package.json b/packages/wallets/wallet-cosmos/package.json index 2f5b17c90..9ccba24c9 100644 --- a/packages/wallets/wallet-cosmos/package.json +++ b/packages/wallets/wallet-cosmos/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-cosmos", "description": "Cosmos wallet strategies for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -39,10 +39,10 @@ "@cosmjs/stargate": "^0.32.3", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", "@keplr-wallet/cosmos": "^0.12.71", "@keplr-wallet/types": "^0.12.71", "shx": "^0.3.3" diff --git a/packages/wallets/wallet-cosmostation/package.json b/packages/wallets/wallet-cosmostation/package.json index 05896a408..572004068 100644 --- a/packages/wallets/wallet-cosmostation/package.json +++ b/packages/wallets/wallet-cosmostation/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-cosmostation", "description": "Cosmostation strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -36,10 +36,10 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmostation/extension-client": "^0.1.15", "@injectivelabs/exceptions": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", "@walletconnect/ethereum-provider": "^2.12.2" }, "gitHead": "6442ae377bbfb3459d2fb3a44c650630a5b7f445", diff --git a/packages/wallets/wallet-evm/package.json b/packages/wallets/wallet-evm/package.json index 4ed09a7c2..8dbdc87be 100644 --- a/packages/wallets/wallet-evm/package.json +++ b/packages/wallets/wallet-evm/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-evm", "description": "EVM wallet strategies for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -35,7 +35,7 @@ "dependencies": { "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", "ethers": "^6.5.1", diff --git a/packages/wallets/wallet-ledger/package.json b/packages/wallets/wallet-ledger/package.json index 3cb6342b1..91b72adc1 100644 --- a/packages/wallets/wallet-ledger/package.json +++ b/packages/wallets/wallet-ledger/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-ledger", "description": "Ledger wallet strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -37,10 +37,10 @@ "@ethereumjs/tx": "^4.1.1", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", "@ledgerhq/hw-app-cosmos": "^6.29.5", "@ledgerhq/hw-app-eth": "6.35.6", "@ledgerhq/hw-transport": "6.30.4", diff --git a/packages/wallets/wallet-magic/package.json b/packages/wallets/wallet-magic/package.json index d92df1b29..486e8f064 100644 --- a/packages/wallets/wallet-magic/package.json +++ b/packages/wallets/wallet-magic/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-magic", "description": "Magic wallet strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -34,10 +34,10 @@ }, "dependencies": { "@injectivelabs/exceptions": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", "@magic-ext/cosmos": "23.9.1", "@magic-ext/oauth2": "9.9.0", "magic-sdk": "28.9.0" diff --git a/packages/wallets/wallet-private-key/package.json b/packages/wallets/wallet-private-key/package.json index ebf2f8d72..2249f1449 100644 --- a/packages/wallets/wallet-private-key/package.json +++ b/packages/wallets/wallet-private-key/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-private-key", "description": "Private key wallet strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -34,10 +34,10 @@ }, "dependencies": { "@injectivelabs/exceptions": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6" + "@injectivelabs/wallet-base": "^0.0.7-alpha.0" }, "gitHead": "6442ae377bbfb3459d2fb3a44c650630a5b7f445", "typedoc": { diff --git a/packages/wallets/wallet-strategy/package.json b/packages/wallets/wallet-strategy/package.json index 0fdb4ee76..70861e674 100644 --- a/packages/wallets/wallet-strategy/package.json +++ b/packages/wallets/wallet-strategy/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-strategy", "description": "Wallet strategy with instantiated wallets", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -37,19 +37,19 @@ "@ethereumjs/tx": "^4.1.1", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", - "@injectivelabs/wallet-core": "^0.0.6", - "@injectivelabs/wallet-cosmos": "^0.0.6", - "@injectivelabs/wallet-cosmostation": "^0.0.6", - "@injectivelabs/wallet-evm": "^0.0.6", - "@injectivelabs/wallet-ledger": "^0.0.6", - "@injectivelabs/wallet-magic": "^0.0.6", - "@injectivelabs/wallet-private-key": "^0.0.6", - "@injectivelabs/wallet-trezor": "^0.0.6", - "@injectivelabs/wallet-wallet-connect": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", + "@injectivelabs/wallet-core": "^0.0.7-alpha.0", + "@injectivelabs/wallet-cosmos": "^0.0.7-alpha.0", + "@injectivelabs/wallet-cosmostation": "^0.0.7-alpha.0", + "@injectivelabs/wallet-evm": "^0.0.7-alpha.0", + "@injectivelabs/wallet-ledger": "^0.0.7-alpha.0", + "@injectivelabs/wallet-magic": "^0.0.7-alpha.0", + "@injectivelabs/wallet-private-key": "^0.0.7-alpha.0", + "@injectivelabs/wallet-trezor": "^0.0.7-alpha.0", + "@injectivelabs/wallet-wallet-connect": "^0.0.7-alpha.0", "alchemy-sdk": "^3.4.7", "eip1193-provider": "^1.0.1", "eth-sig-util": "^3.0.1", diff --git a/packages/wallets/wallet-trezor/package.json b/packages/wallets/wallet-trezor/package.json index 70f6aa0e2..7da572bb8 100644 --- a/packages/wallets/wallet-trezor/package.json +++ b/packages/wallets/wallet-trezor/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-trezor", "description": "Trezor wallet strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -37,10 +37,10 @@ "@ethereumjs/tx": "^4.1.1", "@injectivelabs/exceptions": "^1.14.19", "@injectivelabs/networks": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", "@trezor/connect-web": "9.2.1", "alchemy-sdk": "^3.4.7", "eip1193-provider": "^1.0.1", diff --git a/packages/wallets/wallet-wallet-connect/package.json b/packages/wallets/wallet-wallet-connect/package.json index 1d98c7e8b..f362e0fd9 100644 --- a/packages/wallets/wallet-wallet-connect/package.json +++ b/packages/wallets/wallet-wallet-connect/package.json @@ -1,7 +1,7 @@ { "name": "@injectivelabs/wallet-wallet-connect", "description": "Wallet connect strategy for use with @injectivelabs/wallet-core.", - "version": "0.0.6", + "version": "0.0.7-alpha.0", "sideEffects": false, "author": { "name": "InjectiveLabs", @@ -34,10 +34,10 @@ }, "dependencies": { "@injectivelabs/exceptions": "^1.14.19", - "@injectivelabs/sdk-ts": "^1.14.19", + "@injectivelabs/sdk-ts": "^1.14.20-alpha.0", "@injectivelabs/ts-types": "^1.14.19", "@injectivelabs/utils": "^1.14.19", - "@injectivelabs/wallet-base": "^0.0.6", + "@injectivelabs/wallet-base": "^0.0.7-alpha.0", "@walletconnect/ethereum-provider": "^2.12.2" }, "gitHead": "6442ae377bbfb3459d2fb3a44c650630a5b7f445", diff --git a/proto/core/gen.sh b/proto/core/gen.sh index f0e087495..be7b25280 100755 --- a/proto/core/gen.sh +++ b/proto/core/gen.sh @@ -8,7 +8,7 @@ TS_OUTPUT_DIR=$ROOT_DIR/proto-ts TS_STUB_DIR=$ROOT_DIR/stub # remote branches/tags -injective_core_branch=dev +injective_core_branch=f/permissions-rework cosmos_sdk_branch=v0.50.x-inj wasmd_branch=v0.50.x-inj ibc_go_branch=v8.3.2 diff --git a/yarn.lock b/yarn.lock index 61ae99cd9..d0322154e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2183,10 +2183,10 @@ resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== -"@injectivelabs/core-proto-ts@1.13.3": - version "1.13.3" - resolved "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-1.13.3.tgz#9f2a57106d89d414ea1f9e5ea8287e6f08713271" - integrity sha512-G7gr9pJM/bDDtmW8fuXlUQZ+pNjFsypxM8gpd6bA7BbbBnZArdC8NlZvqfHgKYcaI27/CwIix2jlnz0okstjMg== +"@injectivelabs/core-proto-ts@1.13.3-dev.0": + version "1.13.3-dev.0" + resolved "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-1.13.3-dev.0.tgz#681dbd037c09d46476ebda84dd21a0053b7792ab" + integrity sha512-eqPM96ZysdQvpnAx7VImCat5+186wb0vkrATn63k+M4RfnAhGvE1C1bhtu0cwKaswPSNZuvwDEHf2GikE9X1qw== dependencies: "@injectivelabs/grpc-web" "^0.0.1" google-protobuf "^3.14.0"