@ocap/sdk 1.18.27 → 1.18.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +37 -58
  2. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { LiteralUnion } from 'type-fest';
4
4
  import rightPad from 'lodash/padEnd';
5
5
  import leftPad from 'lodash/padStart';
6
6
  import BN from 'bn.js';
7
+ export declare const isBase58btc: (data: any) => boolean;
7
8
  export declare type BytesType = string | Buffer | Uint8Array;
8
9
  export declare type EncodingType = LiteralUnion<
9
10
  'hex' | 'base16' | 'base58' | 'base64' | 'Uint8Array' | 'buffer',
@@ -373,7 +374,7 @@ type PartialDeep<T> = {
373
374
 
374
375
  /*~ Write your module's methods and properties in this class */
375
376
  declare interface OcapSDK {
376
- constructor(httpEndpoint: string);
377
+ constructor(endpoint: string, autoInit: boolean = true);
377
378
 
378
379
  getQueries(): string[];
379
380
  getSubscriptions(): string[];
@@ -797,112 +798,90 @@ declare interface OcapSDK {
797
798
  ): Promise<GraphQLClient.Transaction>;
798
799
  getAccountState(
799
800
  params: PartialDeep<GraphQLClient.GetAccountStateParams>
800
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetAccountState>>;
801
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetAccountState>;
801
802
  getAssetState(
802
803
  params: PartialDeep<GraphQLClient.GetAssetStateParams>
803
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetAssetState>>;
804
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetAssetState>;
804
805
  getFactoryState(
805
806
  params: PartialDeep<GraphQLClient.GetFactoryStateParams>
806
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetFactoryState>>;
807
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetFactoryState>;
807
808
  getDelegateState(
808
809
  params: PartialDeep<GraphQLClient.GetDelegateStateParams>
809
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetDelegateState>>;
810
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetDelegateState>;
810
811
  getTokenState(
811
812
  params: PartialDeep<GraphQLClient.GetTokenStateParams>
812
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetTokenState>>;
813
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetTokenState>;
813
814
  getEvidenceState(
814
815
  params: PartialDeep<GraphQLClient.GetEvidenceStateParams>
815
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetEvidenceState>>;
816
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetEvidenceState>;
816
817
  getForgeState(
817
818
  params: PartialDeep<GraphQLClient.GetForgeStateParams>
818
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetForgeState>>;
819
- getTx(
820
- params: PartialDeep<GraphQLClient.GetTxParams>
821
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetTx>>;
822
- getBlock(
823
- params: PartialDeep<GraphQLClient.GetBlockParams>
824
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetBlock>>;
825
- getBlocks(
826
- params: PartialDeep<GraphQLClient.GetBlocksParams>
827
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetBlocks>>;
819
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetForgeState>;
820
+ getTx(params: PartialDeep<GraphQLClient.GetTxParams>): Promise<GraphQLClient.GraphQLClient.ResponseGetTx>;
821
+ getBlock(params: PartialDeep<GraphQLClient.GetBlockParams>): Promise<GraphQLClient.GraphQLClient.ResponseGetBlock>;
822
+ getBlocks(params: PartialDeep<GraphQLClient.GetBlocksParams>): Promise<GraphQLClient.GraphQLClient.ResponseGetBlocks>;
828
823
  getUnconfirmedTxs(
829
824
  params: PartialDeep<GraphQLClient.GetUnconfirmedTxsParams>
830
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetUnconfirmedTxs>>;
831
- getChainInfo(): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetChainInfo>>;
832
- getConfig(
833
- params: PartialDeep<GraphQLClient.GetConfigParams>
834
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetConfig>>;
835
- getNetInfo(): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetNetInfo>>;
836
- getNodeInfo(): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetNodeInfo>>;
837
- getValidatorsInfo(): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetValidatorsInfo>>;
838
- getForgeStats(): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetForgeStats>>;
825
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetUnconfirmedTxs>;
826
+ getChainInfo(): Promise<GraphQLClient.GraphQLClient.ResponseGetChainInfo>;
827
+ getConfig(params: PartialDeep<GraphQLClient.GetConfigParams>): Promise<GraphQLClient.GraphQLClient.ResponseGetConfig>;
828
+ getNetInfo(): Promise<GraphQLClient.GraphQLClient.ResponseGetNetInfo>;
829
+ getNodeInfo(): Promise<GraphQLClient.GraphQLClient.ResponseGetNodeInfo>;
830
+ getValidatorsInfo(): Promise<GraphQLClient.GraphQLClient.ResponseGetValidatorsInfo>;
831
+ getForgeStats(): Promise<GraphQLClient.GraphQLClient.ResponseGetForgeStats>;
839
832
  listAssetTransactions(
840
833
  params: PartialDeep<GraphQLClient.ListAssetTransactionsParams>
841
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListAssetTransactions>>;
834
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListAssetTransactions>;
842
835
  listAssets(
843
836
  params: PartialDeep<GraphQLClient.ListAssetsParams>
844
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListAssets>>;
837
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListAssets>;
845
838
  listBlocks(
846
839
  params: PartialDeep<GraphQLClient.ListBlocksParams>
847
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListBlocks>>;
840
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListBlocks>;
848
841
  listTopAccounts(
849
842
  params: PartialDeep<GraphQLClient.ListTopAccountsParams>
850
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListTopAccounts>>;
843
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListTopAccounts>;
851
844
  listTransactions(
852
845
  params: PartialDeep<GraphQLClient.ListTransactionsParams>
853
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListTransactions>>;
846
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListTransactions>;
854
847
  listTokens(
855
848
  params: PartialDeep<GraphQLClient.ListTokensParams>
856
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListTokens>>;
849
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListTokens>;
857
850
  listFactories(
858
851
  params: PartialDeep<GraphQLClient.ListFactoriesParams>
859
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListFactories>>;
852
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListFactories>;
860
853
  getAccountTokens(
861
854
  params: PartialDeep<GraphQLClient.GetAccountTokensParams>
862
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetAccountTokens>>;
855
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetAccountTokens>;
863
856
  getStakeState(
864
857
  params: PartialDeep<GraphQLClient.GetStakeStateParams>
865
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetStakeState>>;
858
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetStakeState>;
866
859
  listStakes(
867
860
  params: PartialDeep<GraphQLClient.ListStakesParams>
868
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListStakes>>;
861
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListStakes>;
869
862
  getRollupState(
870
863
  params: PartialDeep<GraphQLClient.GetRollupStateParams>
871
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetRollupState>>;
864
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetRollupState>;
872
865
  listRollups(
873
866
  params: PartialDeep<GraphQLClient.ListRollupsParams>
874
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListRollups>>;
867
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListRollups>;
875
868
  getRollupBlock(
876
869
  params: PartialDeep<GraphQLClient.GetRollupBlockParams>
877
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseGetRollupBlock>>;
870
+ ): Promise<GraphQLClient.GraphQLClient.ResponseGetRollupBlock>;
878
871
  listRollupBlocks(
879
872
  params: PartialDeep<GraphQLClient.ListRollupBlocksParams>
880
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListRollupBlocks>>;
873
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListRollupBlocks>;
881
874
  listRollupValidators(
882
875
  params: PartialDeep<GraphQLClient.ListRollupValidatorsParams>
883
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseListRollupValidators>>;
884
- search(
885
- params: PartialDeep<GraphQLClient.SearchParams>
886
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseSearch>>;
876
+ ): Promise<GraphQLClient.GraphQLClient.ResponseListRollupValidators>;
877
+ search(params: PartialDeep<GraphQLClient.SearchParams>): Promise<GraphQLClient.GraphQLClient.ResponseSearch>;
887
878
  estimateGas(
888
879
  params: PartialDeep<GraphQLClient.EstimateGasParams>
889
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseEstimateGas>>;
890
- sendTx(
891
- params: PartialDeep<GraphQLClient.SendTxParams>
892
- ): Promise<GraphQLClient.QueryResult<GraphQLClient.ResponseSendTx>>;
880
+ ): Promise<GraphQLClient.GraphQLClient.ResponseEstimateGas>;
881
+ sendTx(params: PartialDeep<GraphQLClient.SendTxParams>): Promise<GraphQLClient.GraphQLClient.ResponseSendTx>;
893
882
  }
894
883
 
895
884
  declare namespace GraphQLClient {
896
- interface QueryResult<T> {
897
- then(fn: (result: T) => any): Promise<any>;
898
- catch(fn: (err: Error) => any): Promise<any>;
899
- }
900
-
901
- interface SubscriptionResult<T> {
902
- then(fn: (result: GraphQLClient.Subscription<T>) => any): Promise<any>;
903
- catch(fn: (err: Error) => any): Promise<any>;
904
- }
905
-
906
885
  interface Subscription<T> {
907
886
  on(event: 'data', fn: (data: T) => any): this;
908
887
  on(event: 'error', fn: (err: Error) => void): this;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocap/sdk",
3
3
  "description": "Forge javascript SDK packages all-in-one",
4
- "version": "1.18.27",
4
+ "version": "1.18.30",
5
5
  "author": {
6
6
  "name": "wangshijun",
7
7
  "email": "shijun@arcblock.io",
@@ -18,11 +18,11 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/did-util": "1.18.27",
22
- "@ocap/client": "1.18.27",
23
- "@ocap/message": "1.18.27",
24
- "@ocap/util": "1.18.27",
25
- "@ocap/wallet": "1.18.27",
21
+ "@arcblock/did-util": "1.18.30",
22
+ "@ocap/client": "1.18.30",
23
+ "@ocap/message": "1.18.30",
24
+ "@ocap/util": "1.18.30",
25
+ "@ocap/wallet": "1.18.30",
26
26
  "buffer": "6.0.3",
27
27
  "debug": "^4.3.4",
28
28
  "react-app-polyfill": "^1.0.6",
@@ -82,5 +82,5 @@
82
82
  "test": "jest --forceExit --detectOpenHandles",
83
83
  "coverage": "yarn test -- --coverage"
84
84
  },
85
- "gitHead": "f71e1836ecfed490799a2e5cc12f7450b22461a5"
85
+ "gitHead": "553b8b4151c97432b4c18ef0ef849cd65e2704cb"
86
86
  }