From f14f3a15b80c91b89d20aaf17ccdc8797418ad1c Mon Sep 17 00:00:00 2001 From: rrr523 <59029880+rrr523@users.noreply.github.com> Date: Tue, 14 Nov 2023 01:19:51 +0800 Subject: [PATCH] refactor: Don't use alias path (#387) --- .changeset/loud-bobcats-kiss.md | 5 ++ packages/js-sdk/config/tsconfig.json | 2 +- packages/js-sdk/src/api/account.ts | 8 +-- packages/js-sdk/src/api/bucket.ts | 70 ++++++++++++------------- packages/js-sdk/src/api/challenge.ts | 6 +-- packages/js-sdk/src/api/crosschain.ts | 12 ++--- packages/js-sdk/src/api/distribution.ts | 13 +++-- packages/js-sdk/src/api/feegrant.ts | 6 +-- packages/js-sdk/src/api/group.ts | 14 ++--- packages/js-sdk/src/api/objectt.ts | 42 +++++++-------- packages/js-sdk/src/api/offchainauth.ts | 4 +- packages/js-sdk/src/api/payment.ts | 18 +++---- packages/js-sdk/src/api/proposal.ts | 16 ++---- packages/js-sdk/src/api/sp.ts | 20 +++---- packages/js-sdk/src/api/storage.ts | 6 +-- packages/js-sdk/src/api/validator.ts | 19 ++----- packages/js-sdk/src/api/virtualGroup.ts | 4 +- 17 files changed, 125 insertions(+), 140 deletions(-) create mode 100644 .changeset/loud-bobcats-kiss.md diff --git a/.changeset/loud-bobcats-kiss.md b/.changeset/loud-bobcats-kiss.md new file mode 100644 index 00000000..2ce82e82 --- /dev/null +++ b/.changeset/loud-bobcats-kiss.md @@ -0,0 +1,5 @@ +--- +'@bnb-chain/greenfield-js-sdk': patch +--- + +refactor: don't use alias path diff --git a/packages/js-sdk/config/tsconfig.json b/packages/js-sdk/config/tsconfig.json index c052eca9..19053003 100644 --- a/packages/js-sdk/config/tsconfig.json +++ b/packages/js-sdk/config/tsconfig.json @@ -35,4 +35,4 @@ "../node_modules", "../src/tests" ] -} \ No newline at end of file +} diff --git a/packages/js-sdk/src/api/account.ts b/packages/js-sdk/src/api/account.ts index 23e0cf6e..81fbe883 100644 --- a/packages/js-sdk/src/api/account.ts +++ b/packages/js-sdk/src/api/account.ts @@ -1,7 +1,7 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgMultiSendSDKTypeEIP712 } from '@/messages/bank/MsgMultiSend'; -import { MsgSendSDKTypeEIP712 } from '@/messages/bank/MsgSend'; -import { MsgCreatePaymentAccountSDKTypeEIP712 } from '@/messages/greenfield/payment/MsgCreatePaymentAccount'; +import { TxClient } from '../clients/txClient'; +import { MsgMultiSendSDKTypeEIP712 } from '../messages/bank/MsgMultiSend'; +import { MsgSendSDKTypeEIP712 } from '../messages/bank/MsgSend'; +import { MsgCreatePaymentAccountSDKTypeEIP712 } from '../messages/greenfield/payment/MsgCreatePaymentAccount'; import { BaseAccount } from '@bnb-chain/greenfield-cosmos-types/cosmos/auth/v1beta1/auth'; import { QueryModuleAccountByNameResponse, diff --git a/packages/js-sdk/src/api/bucket.ts b/packages/js-sdk/src/api/bucket.ts index 11cbd7cd..1ddd2d44 100644 --- a/packages/js-sdk/src/api/bucket.ts +++ b/packages/js-sdk/src/api/bucket.ts @@ -1,38 +1,3 @@ -import { HTTPHeaderUserAddress } from '@/clients/spclient/auth'; -import { getApprovalMetaInfo } from '@/clients/spclient/spApis/approval'; -import { - getBucketMetaInfo, - parseGetBucketMetaResponse, -} from '@/clients/spclient/spApis/getBucketMeta'; -import { - getUserBucketMetaInfo, - parseGetUserBucketsResponse, -} from '@/clients/spclient/spApis/getUserBuckets'; -import { - getListBucketReadRecordMetaInfo, - parseListBucketReadRecordResponse, -} from '@/clients/spclient/spApis/listBucketReadRecords'; -import { - getListBucketsByIDsMetaInfo, - parseListBucketsByIdsResponse, -} from '@/clients/spclient/spApis/listBucketsByIds'; -import { - getListBucketByPaymentMetaInfo, - parseListBucketByPaymentResponse, -} from '@/clients/spclient/spApis/listBucketsByPayment'; -import { parseError } from '@/clients/spclient/spApis/parseError'; -import { - getQueryBucketReadQuotaMetaInfo, - parseReadQuotaResponse, -} from '@/clients/spclient/spApis/queryBucketReadQuota'; -import { TxClient } from '@/clients/txClient'; -import { METHOD_GET, NORMAL_ERROR_CODE } from '@/constants/http'; -import { MsgCreateBucketSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgCreateBucket'; -import { MsgDeleteBucketSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgDeleteBucket'; -import { MsgMigrateBucketSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgMigrateBucket'; -import { MsgUpdateBucketInfoSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgUpdateBucketInfo'; -import { decodeObjectFromHexString } from '@/utils/encoding'; -import { isValidAddress, isValidBucketName, isValidUrl } from '@/utils/s3'; import { UInt64Value } from '@bnb-chain/greenfield-cosmos-types/greenfield/common/wrapper'; import { ActionType, @@ -73,7 +38,40 @@ import { TxResponse, } from '..'; import { RpcQueryClient } from '../clients/queryclient'; +import { HTTPHeaderUserAddress } from '../clients/spclient/auth'; +import { getApprovalMetaInfo } from '../clients/spclient/spApis/approval'; +import { + getBucketMetaInfo, + parseGetBucketMetaResponse, +} from '../clients/spclient/spApis/getBucketMeta'; +import { + getUserBucketMetaInfo, + parseGetUserBucketsResponse, +} from '../clients/spclient/spApis/getUserBuckets'; +import { + getListBucketReadRecordMetaInfo, + parseListBucketReadRecordResponse, +} from '../clients/spclient/spApis/listBucketReadRecords'; +import { + getListBucketsByIDsMetaInfo, + parseListBucketsByIdsResponse, +} from '../clients/spclient/spApis/listBucketsByIds'; +import { + getListBucketByPaymentMetaInfo, + parseListBucketByPaymentResponse, +} from '../clients/spclient/spApis/listBucketsByPayment'; +import { parseError } from '../clients/spclient/spApis/parseError'; +import { + getQueryBucketReadQuotaMetaInfo, + parseReadQuotaResponse, +} from '../clients/spclient/spApis/queryBucketReadQuota'; import { AuthType, SpClient } from '../clients/spclient/spClient'; +import { TxClient } from '../clients/txClient'; +import { METHOD_GET, NORMAL_ERROR_CODE } from '../constants/http'; +import { MsgCreateBucketSDKTypeEIP712 } from '../messages/greenfield/storage/MsgCreateBucket'; +import { MsgDeleteBucketSDKTypeEIP712 } from '../messages/greenfield/storage/MsgDeleteBucket'; +import { MsgMigrateBucketSDKTypeEIP712 } from '../messages/greenfield/storage/MsgMigrateBucket'; +import { MsgUpdateBucketInfoSDKTypeEIP712 } from '../messages/greenfield/storage/MsgUpdateBucketInfo'; import type { CreateBucketApprovalRequest, CreateBucketApprovalResponse, @@ -93,6 +91,8 @@ import type { ReadQuotaRequest, SpResponse, } from '../types/sp'; +import { decodeObjectFromHexString } from '../utils/encoding'; +import { isValidAddress, isValidBucketName, isValidUrl } from '../utils/s3'; import { Sp } from './sp'; import { Storage } from './storage'; diff --git a/packages/js-sdk/src/api/challenge.ts b/packages/js-sdk/src/api/challenge.ts index c7f8193a..7a2df719 100644 --- a/packages/js-sdk/src/api/challenge.ts +++ b/packages/js-sdk/src/api/challenge.ts @@ -1,6 +1,3 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgAttestSDKTypeEIP712 } from '@/messages/greenfield/chanenge/MsgAttest'; -import { MsgSubmitSDKTypeEIP712 } from '@/messages/greenfield/chanenge/MsgSubmit'; import { QueryInturnAttestationSubmitterResponse, QueryLatestAttestedChallengesResponse, @@ -10,6 +7,9 @@ import { MsgAttest, MsgSubmit } from '@bnb-chain/greenfield-cosmos-types/greenfi import { container, delay, inject, injectable } from 'tsyringe'; import { MsgAttestTypeUrl, MsgSubmitTypeUrl, TxResponse } from '..'; import { RpcQueryClient } from '../clients/queryclient'; +import { TxClient } from '../clients/txClient'; +import { MsgAttestSDKTypeEIP712 } from '../messages/greenfield/chanenge/MsgAttest'; +import { MsgSubmitSDKTypeEIP712 } from '../messages/greenfield/chanenge/MsgSubmit'; export interface IChallenge { // TODO: getChallengeInfo(); diff --git a/packages/js-sdk/src/api/crosschain.ts b/packages/js-sdk/src/api/crosschain.ts index bae79efa..ae6d53e7 100644 --- a/packages/js-sdk/src/api/crosschain.ts +++ b/packages/js-sdk/src/api/crosschain.ts @@ -1,9 +1,3 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgClaimSDKTypeEIP712 } from '@/messages/cosmos/oracle/MsgClaim'; -import { MsgTransferOutSDKTypeEIP712 } from '@/messages/greenfield/bridge/MsgTransferOut'; -import { MsgMirrorBucketSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgMirrorBucket'; -import { MsgMirrorGroupSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgMirrorGroup'; -import { MsgMirrorObjectSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgMirrorObject'; import { QueryCrossChainPackageRequest, QueryCrossChainPackageResponse, @@ -31,6 +25,12 @@ import { TxResponse, } from '..'; import { RpcQueryClient } from '../clients/queryclient'; +import { TxClient } from '../clients/txClient'; +import { MsgClaimSDKTypeEIP712 } from '../messages/cosmos/oracle/MsgClaim'; +import { MsgTransferOutSDKTypeEIP712 } from '../messages/greenfield/bridge/MsgTransferOut'; +import { MsgMirrorBucketSDKTypeEIP712 } from '../messages/greenfield/storage/MsgMirrorBucket'; +import { MsgMirrorGroupSDKTypeEIP712 } from '../messages/greenfield/storage/MsgMirrorGroup'; +import { MsgMirrorObjectSDKTypeEIP712 } from '../messages/greenfield/storage/MsgMirrorObject'; export interface ICrossChain { /** diff --git a/packages/js-sdk/src/api/distribution.ts b/packages/js-sdk/src/api/distribution.ts index 3a0d5206..53b26154 100644 --- a/packages/js-sdk/src/api/distribution.ts +++ b/packages/js-sdk/src/api/distribution.ts @@ -1,15 +1,10 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgFundCommunityPoolTypeUrlSDKTypeEIP712 } from '@/messages/cosmos/distribution/MsgFundCommunityPoolTypeUrl'; -import { MsgSetWithdrawAddressSDKTypeEIP712 } from '@/messages/cosmos/distribution/MsgSetWithdrawAddress'; -import { MsgWithdrawDelegatorRewardSDKTypeEIP712 } from '@/messages/cosmos/distribution/MsgWithdrawDelegatorReward'; -import { MsgWithdrawValidatorCommissionSDKTypeEIP712 } from '@/messages/cosmos/distribution/MsgWithdrawValidatorCommission'; import { MsgFundCommunityPool, MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, } from '@bnb-chain/greenfield-cosmos-types/cosmos/distribution/v1beta1/tx'; -import { container, delay, inject, injectable } from 'tsyringe'; +import { delay, inject, injectable } from 'tsyringe'; import { MsgFundCommunityPoolTypeUrl, MsgSetWithdrawAddressTypeUrl, @@ -17,7 +12,11 @@ import { MsgWithdrawValidatorCommissionTypeUrl, TxResponse, } from '..'; -import { RpcQueryClient } from '../clients/queryclient'; +import { TxClient } from '../clients/txClient'; +import { MsgFundCommunityPoolTypeUrlSDKTypeEIP712 } from '../messages/cosmos/distribution/MsgFundCommunityPoolTypeUrl'; +import { MsgSetWithdrawAddressSDKTypeEIP712 } from '../messages/cosmos/distribution/MsgSetWithdrawAddress'; +import { MsgWithdrawDelegatorRewardSDKTypeEIP712 } from '../messages/cosmos/distribution/MsgWithdrawDelegatorReward'; +import { MsgWithdrawValidatorCommissionSDKTypeEIP712 } from '../messages/cosmos/distribution/MsgWithdrawValidatorCommission'; export interface IDistribution { /** * sets the withdrawal address for a delegator address diff --git a/packages/js-sdk/src/api/feegrant.ts b/packages/js-sdk/src/api/feegrant.ts index 41ee65af..fc381d46 100644 --- a/packages/js-sdk/src/api/feegrant.ts +++ b/packages/js-sdk/src/api/feegrant.ts @@ -1,6 +1,6 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgGrantAllowanceSDKTypeEIP712 } from '@/messages/feegrant/MsgGrantAllowance'; -import { MsgRevokeAllowanceSDKTypeEIP712 } from '@/messages/feegrant/MsgRevokeAllowance'; +import { TxClient } from '../clients/txClient'; +import { MsgGrantAllowanceSDKTypeEIP712 } from '../messages/feegrant/MsgGrantAllowance'; +import { MsgRevokeAllowanceSDKTypeEIP712 } from '../messages/feegrant/MsgRevokeAllowance'; import { QueryAllowanceRequest, QueryAllowanceResponse, diff --git a/packages/js-sdk/src/api/group.ts b/packages/js-sdk/src/api/group.ts index e0fb5d2b..a4525871 100644 --- a/packages/js-sdk/src/api/group.ts +++ b/packages/js-sdk/src/api/group.ts @@ -1,10 +1,10 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgCreateGroupSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgCreateGroup'; -import { MsgDeleteGroupSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgDeleteGroup'; -import { MsgLeaveGroupSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgLeaveGroup'; -import { MsgUpdateGroupExtraSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgUpdateGroupExtra'; -import { getMsgUpdateGroupMemberSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgUpdateGroupMember'; -import { GRNToString, newBucketGRN, newGroupGRN, newObjectGRN } from '@/utils/grn'; +import { TxClient } from '../clients/txClient'; +import { MsgCreateGroupSDKTypeEIP712 } from '../messages/greenfield/storage/MsgCreateGroup'; +import { MsgDeleteGroupSDKTypeEIP712 } from '../messages/greenfield/storage/MsgDeleteGroup'; +import { MsgLeaveGroupSDKTypeEIP712 } from '../messages/greenfield/storage/MsgLeaveGroup'; +import { MsgUpdateGroupExtraSDKTypeEIP712 } from '../messages/greenfield/storage/MsgUpdateGroupExtra'; +import { getMsgUpdateGroupMemberSDKTypeEIP712 } from '../messages/greenfield/storage/MsgUpdateGroupMember'; +import { GRNToString, newBucketGRN, newGroupGRN, newObjectGRN } from '../utils/grn'; import { QueryGroupNFTResponse, QueryHeadGroupMemberResponse, diff --git a/packages/js-sdk/src/api/objectt.ts b/packages/js-sdk/src/api/objectt.ts index fd877c95..6b924ec1 100644 --- a/packages/js-sdk/src/api/objectt.ts +++ b/packages/js-sdk/src/api/objectt.ts @@ -1,32 +1,32 @@ -import { encodePath, getMsgToSign, getSortQuery, secpSign } from '@/clients/spclient/auth'; -import { getApprovalMetaInfo } from '@/clients/spclient/spApis/approval'; -import { getGetObjectMetaInfo } from '@/clients/spclient/spApis/getObject'; +import { encodePath, getMsgToSign, getSortQuery, secpSign } from '../clients/spclient/auth'; +import { getApprovalMetaInfo } from '../clients/spclient/spApis/approval'; +import { getGetObjectMetaInfo } from '../clients/spclient/spApis/getObject'; import { getObjectMetaInfo, parseGetObjectMetaResponse, -} from '@/clients/spclient/spApis/getObjectMeta'; +} from '../clients/spclient/spApis/getObjectMeta'; import { getListObjectPoliciesMetaInfo, parseGetListObjectPoliciesResponse, -} from '@/clients/spclient/spApis/listObjectPolicies'; -import { parseListObjectsByBucketNameResponse } from '@/clients/spclient/spApis/listObjectsByBucket'; +} from '../clients/spclient/spApis/listObjectPolicies'; +import { parseListObjectsByBucketNameResponse } from '../clients/spclient/spApis/listObjectsByBucket'; import { getListObjectsByIDsMetaInfo, parseListObjectsByIdsResponse, -} from '@/clients/spclient/spApis/listObjectsByIds'; -import { parseError } from '@/clients/spclient/spApis/parseError'; -import { getPutObjectMetaInfo } from '@/clients/spclient/spApis/putObject'; -import { TxClient } from '@/clients/txClient'; -import { METHOD_GET, NORMAL_ERROR_CODE } from '@/constants/http'; -import { MsgCancelCreateObjectSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgCancelCreateObject'; -import { MsgCreateObjectSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgCreateObject'; -import { MsgDeleteObjectSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgDeleteObject'; -import { MsgUpdateObjectInfoSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgUpdateObjectInfo'; -import { signSignatureByEddsa } from '@/offchainauth'; -import { GetObjectRequest } from '@/types/sp/GetObject'; -import { GetObjectMetaRequest, GetObjectMetaResponse } from '@/types/sp/GetObjectMeta'; -import { ListObjectsByBucketNameResponse } from '@/types/sp/ListObjectsByBucketName'; -import { PutObjectRequest } from '@/types/sp/PutObject'; +} from '../clients/spclient/spApis/listObjectsByIds'; +import { parseError } from '../clients/spclient/spApis/parseError'; +import { getPutObjectMetaInfo } from '../clients/spclient/spApis/putObject'; +import { TxClient } from '../clients/txClient'; +import { METHOD_GET, NORMAL_ERROR_CODE } from '../constants/http'; +import { MsgCancelCreateObjectSDKTypeEIP712 } from '../messages/greenfield/storage/MsgCancelCreateObject'; +import { MsgCreateObjectSDKTypeEIP712 } from '../messages/greenfield/storage/MsgCreateObject'; +import { MsgDeleteObjectSDKTypeEIP712 } from '../messages/greenfield/storage/MsgDeleteObject'; +import { MsgUpdateObjectInfoSDKTypeEIP712 } from '../messages/greenfield/storage/MsgUpdateObjectInfo'; +import { signSignatureByEddsa } from '../offchainauth'; +import { GetObjectRequest } from '../types/sp/GetObject'; +import { GetObjectMetaRequest, GetObjectMetaResponse } from '../types/sp/GetObjectMeta'; +import { ListObjectsByBucketNameResponse } from '../types/sp/ListObjectsByBucketName'; +import { PutObjectRequest } from '../types/sp/PutObject'; import { ActionType, Principal, @@ -173,8 +173,6 @@ export interface IObject { listObjectPolicies( params: GetListObjectPoliciesRequest, ): Promise>; - // TODO: GetObjectUploadProgress - // TODO: getObjectStatusFromSP } @injectable() diff --git a/packages/js-sdk/src/api/offchainauth.ts b/packages/js-sdk/src/api/offchainauth.ts index 1c0bb6e9..d1169893 100644 --- a/packages/js-sdk/src/api/offchainauth.ts +++ b/packages/js-sdk/src/api/offchainauth.ts @@ -1,4 +1,4 @@ -import { NORMAL_ERROR_CODE } from '@/constants/http'; +import { NORMAL_ERROR_CODE } from '../constants/http'; import { fetchNonces, genLocalSignMsg, @@ -7,7 +7,7 @@ import { getCurrentSeedString, personalSign, updateSpsPubKey, -} from '@/offchainauth'; +} from '../offchainauth'; import { hexlify } from '@ethersproject/bytes'; import { injectable } from 'tsyringe'; import { convertTimeStampToDate, getUtcZeroTimestamp, SpResponse } from '..'; diff --git a/packages/js-sdk/src/api/payment.ts b/packages/js-sdk/src/api/payment.ts index 60a35158..31ec7b71 100644 --- a/packages/js-sdk/src/api/payment.ts +++ b/packages/js-sdk/src/api/payment.ts @@ -1,12 +1,3 @@ -import { - getListUserPaymentAccountMetaInfo, - parseListUserPaymentAccountResponse, -} from '@/clients/spclient/spApis/listUserPaymentAccounts'; -import { AuthType, SpClient } from '@/clients/spclient/spClient'; -import { TxClient } from '@/clients/txClient'; -import { MsgDepositSDKTypeEIP712 } from '@/messages/greenfield/payment/MsgDeposit'; -import { MsgDisableRefundSDKTypeEIP712 } from '@/messages/greenfield/payment/MsgDisableRefund'; -import { MsgWithdrawSDKTypeEIP712 } from '@/messages/greenfield/payment/MsgWithdraw'; import { QueryAutoSettleRecordsRequest, QueryAutoSettleRecordsResponse, @@ -46,6 +37,15 @@ import { TxResponse, } from '..'; import { RpcQueryClient } from '../clients/queryclient'; +import { + getListUserPaymentAccountMetaInfo, + parseListUserPaymentAccountResponse, +} from '../clients/spclient/spApis/listUserPaymentAccounts'; +import { AuthType, SpClient } from '../clients/spclient/spClient'; +import { TxClient } from '../clients/txClient'; +import { MsgDepositSDKTypeEIP712 } from '../messages/greenfield/payment/MsgDeposit'; +import { MsgDisableRefundSDKTypeEIP712 } from '../messages/greenfield/payment/MsgDisableRefund'; +import { MsgWithdrawSDKTypeEIP712 } from '../messages/greenfield/payment/MsgWithdraw'; import { ListUserPaymentAccountsResponse, ListUserPaymentAccountsResquest, diff --git a/packages/js-sdk/src/api/proposal.ts b/packages/js-sdk/src/api/proposal.ts index f4360756..34afb104 100644 --- a/packages/js-sdk/src/api/proposal.ts +++ b/packages/js-sdk/src/api/proposal.ts @@ -1,19 +1,11 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgSubmitProposalSDKTypeEIP712 } from '@/messages/cosmos/gov/MsgSubmitProposal'; -import { MsgVoteSDKTypeEIP712 } from '@/messages/cosmos/gov/MsgVote'; import { voteOptionToJSON } from '@bnb-chain/greenfield-cosmos-types/cosmos/gov/v1/gov'; import { MsgSubmitProposal, MsgVote } from '@bnb-chain/greenfield-cosmos-types/cosmos/gov/v1/tx'; import { MsgCreateValidator } from '@bnb-chain/greenfield-cosmos-types/cosmos/staking/v1beta1/tx'; -import { Any } from '@bnb-chain/greenfield-cosmos-types/google/protobuf/any'; -import { arrayify, hexlify } from '@ethersproject/bytes'; import { delay, inject, injectable } from 'tsyringe'; -import { - base64FromBytes, - encodeToHex, - MsgSubmitProposalTypeUrl, - MsgVoteTypeUrl, - TxResponse, -} from '..'; +import { encodeToHex, MsgSubmitProposalTypeUrl, MsgVoteTypeUrl, TxResponse } from '..'; +import { TxClient } from '../clients/txClient'; +import { MsgSubmitProposalSDKTypeEIP712 } from '../messages/cosmos/gov/MsgSubmitProposal'; +import { MsgVoteSDKTypeEIP712 } from '../messages/cosmos/gov/MsgVote'; export interface IProposal { /** diff --git a/packages/js-sdk/src/api/sp.ts b/packages/js-sdk/src/api/sp.ts index a5a60c6e..abe98df8 100644 --- a/packages/js-sdk/src/api/sp.ts +++ b/packages/js-sdk/src/api/sp.ts @@ -1,16 +1,16 @@ -import { encodePath, HTTPHeaderUserAddress } from '@/clients/spclient/auth'; +import { encodePath, HTTPHeaderUserAddress } from '../clients/spclient/auth'; import { getListGroupMetaInfo, parseListGroupsResponse, -} from '@/clients/spclient/spApis/listGroups'; -import { parseListGroupsMembersResponse } from '@/clients/spclient/spApis/listGroupsMembers'; -import { parseListUserGroupsResponse } from '@/clients/spclient/spApis/listUserGroups'; -import { parseListUserOwnedGroupsResponse } from '@/clients/spclient/spApis/listUserOwnedGroups'; -import { parseError } from '@/clients/spclient/spApis/parseError'; -import { parseVerifyPermissionResponse } from '@/clients/spclient/spApis/verifyPermission'; -import { SpClient } from '@/clients/spclient/spClient'; -import { METHOD_GET, NORMAL_ERROR_CODE } from '@/constants/http'; -import { ListUserOwnedGroupsResponse } from '@/types/sp/ListUserOwnedGroups'; +} from '../clients/spclient/spApis/listGroups'; +import { parseListGroupsMembersResponse } from '../clients/spclient/spApis/listGroupsMembers'; +import { parseListUserGroupsResponse } from '../clients/spclient/spApis/listUserGroups'; +import { parseListUserOwnedGroupsResponse } from '../clients/spclient/spApis/listUserOwnedGroups'; +import { parseError } from '../clients/spclient/spApis/parseError'; +import { parseVerifyPermissionResponse } from '../clients/spclient/spApis/verifyPermission'; +import { SpClient } from '../clients/spclient/spClient'; +import { METHOD_GET, NORMAL_ERROR_CODE } from '../constants/http'; +import { ListUserOwnedGroupsResponse } from '../types/sp/ListUserOwnedGroups'; import { actionTypeFromJSON } from '@bnb-chain/greenfield-cosmos-types/greenfield/permission/common'; import { QueryGlobalSpStorePriceByTimeRequest, diff --git a/packages/js-sdk/src/api/storage.ts b/packages/js-sdk/src/api/storage.ts index a781ff3a..8dbc518c 100644 --- a/packages/js-sdk/src/api/storage.ts +++ b/packages/js-sdk/src/api/storage.ts @@ -1,6 +1,6 @@ -import { TxClient } from '@/clients/txClient'; -import { getMsgPutPolicySDKTypeEIP712 } from '@/messages/greenfield'; -import { MsgDeletePolicySDKTypeEIP712 } from '@/messages/greenfield/storage/MsgDeletePolicy'; +import { TxClient } from '../clients/txClient'; +import { getMsgPutPolicySDKTypeEIP712 } from '../messages/greenfield'; +import { MsgDeletePolicySDKTypeEIP712 } from '../messages/greenfield/storage/MsgDeletePolicy'; import { QueryGroupMembersExistRequest, QueryGroupMembersExistResponse, diff --git a/packages/js-sdk/src/api/validator.ts b/packages/js-sdk/src/api/validator.ts index cf0e9188..d11daaaa 100644 --- a/packages/js-sdk/src/api/validator.ts +++ b/packages/js-sdk/src/api/validator.ts @@ -1,8 +1,3 @@ -import { RpcQueryClient } from '@/clients/queryclient'; -import { TxClient } from '@/clients/txClient'; -import { MsgCreateValidatorSDKTypeEIP712 } from '@/messages/cosmos/staking/MsgCreateValidator'; -import { MsgEditValidatorSDKTypeEIP712 } from '@/messages/cosmos/staking/MsgEditValidator'; -import { MsgSubmitProposal } from '@bnb-chain/greenfield-cosmos-types/cosmos/gov/v1/tx'; import { QueryValidatorsRequest, QueryValidatorsResponse, @@ -11,16 +6,12 @@ import { MsgCreateValidator, MsgEditValidator, } from '@bnb-chain/greenfield-cosmos-types/cosmos/staking/v1beta1/tx'; -import { arrayify } from '@ethersproject/bytes'; import { container, delay, inject, injectable } from 'tsyringe'; -import { - base64FromBytes, - bytesFromBase64, - encodeToHex, - MsgCreateValidatorTypeUrl, - MsgEditValidatorTypeUrl, - TxResponse, -} from '..'; +import { MsgCreateValidatorTypeUrl, MsgEditValidatorTypeUrl, TxResponse } from '..'; +import { RpcQueryClient } from '../clients/queryclient'; +import { TxClient } from '../clients/txClient'; +import { MsgCreateValidatorSDKTypeEIP712 } from '../messages/cosmos/staking/MsgCreateValidator'; +import { MsgEditValidatorSDKTypeEIP712 } from '../messages/cosmos/staking/MsgEditValidator'; import { Proposal } from './proposal'; export interface IValidator { diff --git a/packages/js-sdk/src/api/virtualGroup.ts b/packages/js-sdk/src/api/virtualGroup.ts index 54d05217..9e5a4081 100644 --- a/packages/js-sdk/src/api/virtualGroup.ts +++ b/packages/js-sdk/src/api/virtualGroup.ts @@ -1,5 +1,3 @@ -import { TxClient } from '@/clients/txClient'; -import { MsgSettleSDKTypeEIP712 } from '@/messages/greenfield/virtualgroup/MsgSettle'; import { QueryGlobalVirtualGroupByFamilyIDRequest, QueryGlobalVirtualGroupByFamilyIDResponse, @@ -15,6 +13,8 @@ import { MsgSettle } from '@bnb-chain/greenfield-cosmos-types/greenfield/virtual import { container, delay, inject, injectable } from 'tsyringe'; import { MsgSettleTypeUrl, TxResponse } from '..'; import { RpcQueryClient } from '../clients/queryclient'; +import { TxClient } from '../clients/txClient'; +import { MsgSettleSDKTypeEIP712 } from '../messages/greenfield/virtualgroup/MsgSettle'; export interface IVirtualGroup { params(): Promise;