graz 0.0.42-alpha.3 → 0.0.42

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.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import * as _cosmjs_cosmwasm_stargate from '@cosmjs/cosmwasm-stargate';
2
2
  import { SigningCosmWasmClientOptions, CosmWasmClient, SigningCosmWasmClient, InstantiateOptions, InstantiateResult, ExecuteResult } from '@cosmjs/cosmwasm-stargate';
3
3
  import * as _keplr_wallet_types from '@keplr-wallet/types';
4
- import { ChainInfo, AppCurrency, Key, Keplr } from '@keplr-wallet/types';
4
+ import { ChainInfo, AppCurrency, Keplr, Key } from '@keplr-wallet/types';
5
5
  import * as _cosmjs_proto_signing from '@cosmjs/proto-signing';
6
6
  import { Coin, OfflineSigner, OfflineDirectSigner } from '@cosmjs/proto-signing';
7
7
  import { QueryClient, StargateClient, SigningStargateClient, SigningStargateClientOptions, StdFee, DeliverTxResponse, StakingExtension } from '@cosmjs/stargate';
8
8
  import { Tendermint34Client } from '@cosmjs/tendermint-rpc';
9
+ import { ISignClient, SignClientTypes } from '@walletconnect/types';
10
+ import { Web3ModalConfig } from '@web3modal/standalone';
9
11
  import { Height } from 'cosmjs-types/ibc/core/client/v1/client';
10
12
  import { OfflineSigner as OfflineSigner$1 } from '@cosmjs/launchpad';
11
13
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -98,13 +100,78 @@ declare const defineChain: <T extends GrazChain>(chain: T) => T;
98
100
  * ```
99
101
  */
100
102
  declare const defineChainInfo: <T extends ChainInfoWithPath | ChainInfo>(chain: T) => T;
103
+ /**
104
+ * Provided mainnet chains
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * import { connect, mainnetChains } from "graz";
109
+ * connect(mainnetChains.cosmos);
110
+ * ```
111
+ *
112
+ * @see {@link testnetChains}
113
+ *
114
+ * @deprecated will be removed in the next version use `generate chain` https://graz.strange.love/docs/generate-chain-info
115
+ */
116
+ declare const mainnetChains: {
117
+ axelar: ChainInfo;
118
+ cosmoshub: ChainInfo;
119
+ juno: ChainInfo;
120
+ osmosis: ChainInfo;
121
+ sommelier: ChainInfo;
122
+ };
123
+ /**
124
+ * Arary version on {@link mainnetChains}
125
+ *
126
+ * Try graz cli to generate ChainInfo from https://cosmos.directory/
127
+ * @see https://graz.strange.love/docs/generate-chain-info
128
+ *
129
+ * @see {@link mainnetChains}
130
+ *
131
+ * @deprecated will be removed in the next version use `generate chain` https://graz.strange.love/docs/generate-chain-info
132
+ */
133
+ declare const mainnetChainsArray: ChainInfo[];
134
+ /**
135
+ * Provided testnet chains
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * import { connect, testnetChains } from "graz";
140
+ * connect(testnetChains.osmosis);
141
+ * ```
142
+ *
143
+ * @see {@link mainnetChains}
144
+ *
145
+ * @deprecated will be removed in the next version use `generate chain` https://graz.strange.love/docs/generate-chain-info
146
+ */
147
+ declare const testnetChains: {
148
+ crescent: ChainInfo;
149
+ juno: ChainInfo;
150
+ osmosis: ChainInfo;
151
+ };
152
+ /**
153
+ * Arary version on {@link testnetChains}
154
+ *
155
+ * @see {@link testnetChains}
156
+ *
157
+ * @deprecated will be removed in the next version use `generate chain` https://graz.strange.love/docs/generate-chain-info
158
+ */
159
+ declare const testnetChainsArray: ChainInfo[];
101
160
 
102
161
  declare enum WalletType {
103
162
  KEPLR = "keplr",
104
163
  LEAP = "leap",
105
- COSMOSTATION = "cosmostation"
164
+ COSMOSTATION = "cosmostation",
165
+ WALLETCONNECT = "walletconnect",
166
+ WC_KEPLR_MOBILE = "wc_keplr_mobile",
167
+ WC_LEAP_MOBILE = "wc_leap_mobile",
168
+ WC_COSMOSTATION_MOBILE = "wc_cosmostation_mobile"
106
169
  }
107
170
  declare const WALLET_TYPES: WalletType[];
171
+ type Wallet = Pick<Keplr, "enable" | "getKey" | "getOfflineSigner" | "getOfflineSignerAuto" | "getOfflineSignerOnlyAmino" | "experimentalSuggestChain" | "signDirect" | "signAmino"> & {
172
+ subscription?: (reconnect: () => void) => void;
173
+ init?: () => Promise<unknown>;
174
+ };
108
175
 
109
176
  type ConnectArgs = Maybe<{
110
177
  chain?: GrazChain;
@@ -162,7 +229,22 @@ interface SuggestChainAndConnectArgs {
162
229
  }
163
230
  declare const suggestChainAndConnect: ({ chainInfo, rpcHeaders, gas, path, ...rest }: SuggestChainAndConnectArgs) => Promise<ConnectResult>;
164
231
 
165
- interface GrazStore {
232
+ interface WalletConnectStore {
233
+ options: SignClientTypes.Options | null;
234
+ web3Modal?: Pick<Web3ModalConfig, "themeVariables" | "themeMode" | "privacyPolicyUrl" | "termsOfServiceUrl"> | null;
235
+ }
236
+ interface GrazInternalStore {
237
+ defaultChain: GrazChain | null;
238
+ defaultSigningClient: "cosmWasm" | "stargate";
239
+ recentChain: GrazChain | null;
240
+ walletType: WalletType;
241
+ walletConnect: WalletConnectStore | null;
242
+ _notFoundFn: () => void;
243
+ _reconnect: boolean;
244
+ _reconnectConnector: WalletType | null;
245
+ _onReconnectFailed: () => void;
246
+ }
247
+ interface GrazSessionStore {
166
248
  account: Key | null;
167
249
  activeChain: GrazChain | null;
168
250
  balances: Coin[] | null;
@@ -171,39 +253,33 @@ interface GrazStore {
171
253
  stargate: StargateClient;
172
254
  tendermint: Tendermint34Client;
173
255
  } | null;
174
- defaultChain: GrazChain | null;
175
- defaultSigningClient: "cosmWasm" | "stargate";
176
256
  offlineSigner: (OfflineSigner & OfflineDirectSigner) | null;
177
257
  offlineSignerAmino: OfflineSigner | null;
178
258
  offlineSignerAuto: (OfflineSigner | OfflineDirectSigner) | null;
179
- recentChain: GrazChain | null;
180
259
  signingClients: {
181
260
  cosmWasm: SigningCosmWasmClient;
182
261
  stargate: SigningStargateClient;
183
262
  } | null;
184
263
  status: "connected" | "connecting" | "reconnecting" | "disconnected";
185
- walletType: WalletType;
186
- _notFoundFn: () => void;
187
- _reconnect: boolean;
188
- _reconnectConnector: WalletType | null;
189
- _onReconnectFailed: () => void;
264
+ wcSignClient?: ISignClient | null;
190
265
  }
191
266
 
192
267
  type CreateClientArgs = Pick<GrazChain, "rpc" | "rpcHeaders">;
193
- declare const createClients: ({ rpc, rpcHeaders }: CreateClientArgs) => Promise<GrazStore["clients"]>;
268
+ declare const createClients: ({ rpc, rpcHeaders }: CreateClientArgs) => Promise<GrazSessionStore["clients"]>;
194
269
  type CreateSigningClientArgs = CreateClientArgs & {
195
270
  offlineSignerAuto: OfflineSigner | OfflineDirectSigner;
196
271
  cosmWasmSignerOptions?: SigningCosmWasmClientOptions;
197
272
  stargateSignerOptions?: SigningStargateClientOptions;
198
273
  };
199
- declare const createSigningClients: (args: CreateSigningClientArgs) => Promise<GrazStore["signingClients"]>;
274
+ declare const createSigningClients: (args: CreateSigningClientArgs) => Promise<GrazSessionStore["signingClients"]>;
200
275
 
201
276
  interface ConfigureGrazArgs {
202
277
  defaultChain?: GrazChain;
203
- defaultSigningClient?: GrazStore["defaultSigningClient"];
278
+ defaultSigningClient?: GrazInternalStore["defaultSigningClient"];
204
279
  defaultWallet?: WalletType;
205
280
  onNotFound?: () => void;
206
281
  onReconnectFailed?: () => void;
282
+ walletConnect?: GrazInternalStore["walletConnect"];
207
283
  /**
208
284
  * default to true
209
285
  */
@@ -273,7 +349,7 @@ declare const getQueryRaw: (address: string, keyStr: string) => Promise<Uint8Arr
273
349
  */
274
350
  declare const checkWallet: (type?: WalletType) => boolean;
275
351
  /**
276
- * Function to return {@link Keplr} object and throws and error if it does not exist on `window`.
352
+ * Function to return {@link Wallet} object and throws and error if it does not exist on `window`.
277
353
  *
278
354
  * @example
279
355
  * ```ts
@@ -286,9 +362,9 @@ declare const checkWallet: (type?: WalletType) => boolean;
286
362
  *
287
363
  * @see https://docs.keplr.app
288
364
  */
289
- declare const getKeplr: () => Keplr;
365
+ declare const getKeplr: () => Wallet;
290
366
  /**
291
- * Function to return Leap object (which is {@link Keplr}) and throws and error if it does not exist on `window`.
367
+ * Function to return Leap object (which is {@link Wallet}) and throws and error if it does not exist on `window`.
292
368
  *
293
369
  * @example
294
370
  * ```ts
@@ -301,9 +377,9 @@ declare const getKeplr: () => Keplr;
301
377
  *
302
378
  * @see https://docs.leapwallet.io/cosmos/for-dapps-connect-to-leap/add-leap-to-existing-keplr-integration
303
379
  */
304
- declare const getLeap: () => Keplr;
380
+ declare const getLeap: () => Wallet;
305
381
  /**
306
- * Function to return cosmostation object (which is {@link Keplr}) and throws and error if it does not exist on `window`.
382
+ * Function to return cosmostation object (which is {@link Wallet}) and throws and error if it does not exist on `window`.
307
383
  *
308
384
  * @example
309
385
  * ```ts
@@ -316,7 +392,22 @@ declare const getLeap: () => Keplr;
316
392
  *
317
393
  * @see https://docs.cosmostation.io/integration-extension/cosmos/integrate-keplr
318
394
  */
319
- declare const getCosmostation: () => Keplr;
395
+ declare const getCosmostation: () => Wallet;
396
+ interface GetWalletConnectParams {
397
+ encoding: BufferEncoding;
398
+ walletType: WalletType.WC_KEPLR_MOBILE | WalletType.WC_LEAP_MOBILE;
399
+ appUrl: {
400
+ mobile: {
401
+ ios: string;
402
+ android: string;
403
+ };
404
+ };
405
+ formatNativeUrl: (appUrl: string, wcUri: string, os?: "android" | "ios") => string;
406
+ }
407
+ declare const getWalletConnect: (params?: GetWalletConnectParams) => Wallet;
408
+ declare const getWCKeplr: () => Wallet;
409
+ declare const getWCLeap: () => Wallet;
410
+ declare const getWCCosmostation: () => Wallet;
320
411
  /**
321
412
  * Function to return wallet object based on given {@link WalletType} or from store and throws an error if it does not
322
413
  * exist on `window` or unknown wallet type.
@@ -329,7 +420,7 @@ declare const getCosmostation: () => Keplr;
329
420
  *
330
421
  * @see {@link getKeplr}
331
422
  */
332
- declare const getWallet: (type?: WalletType) => Keplr;
423
+ declare const getWallet: (type?: WalletType) => Wallet;
333
424
  declare const getAvailableWallets: () => Record<WalletType, boolean>;
334
425
 
335
426
  interface AccountData {
@@ -671,6 +762,41 @@ declare const useSuggestChainAndConnect: ({ onError, onLoading, onSuccess }?: Us
671
762
  suggestAndConnectAsync: _tanstack_react_query.UseMutateAsyncFunction<ConnectResult, unknown, SuggestChainAndConnectArgs, unknown>;
672
763
  };
673
764
 
765
+ /**
766
+ * graz query hook to retrieve a CosmWasmClient, StargateClient and Tendermint34Client. If there's no given arguments it will be using the current connected client
767
+ *
768
+ * @example
769
+ * ```ts
770
+ * import { useClient } from "graz";
771
+ *
772
+ * // use connected client's cosmwasm client
773
+ * const { data, isFetching, refetch, ... } = useClient();
774
+ *
775
+ * // initialize new custom client from given arguments
776
+ * useClient({ rpc: "https://rpc.cosmoshub.strange.love", });
777
+ * ```
778
+ */
779
+ declare const useClients: (args?: CreateClientArgs) => UseQueryResult<GrazSessionStore["clients"]>;
780
+ /**
781
+ * graz query hook to retrieve a SigningCosmWasmClient. If there's no given args it will be using the current connected signer
782
+ *
783
+ * @example
784
+ * ```ts
785
+ * import { useSigningClient } from "graz";
786
+ *
787
+ * // get connected client's cosmwasm client
788
+ * const { data, isFetching, refetch, ... } = useSigningClient();
789
+ *
790
+ * // initialize new custom client with given args
791
+ * useSigningClient({
792
+ * rpc: "https://rpc.cosmoshub.strange.love",
793
+ * offlineSigner: customOfflineSigner,
794
+ * ...
795
+ * });
796
+ * ```
797
+ */
798
+ declare const useSigningClients: (args?: CreateSigningClientArgs) => UseQueryResult<GrazSessionStore["signingClients"]>;
799
+
674
800
  interface UseQueryClient {
675
801
  (): UseQueryResult<QueryClient>;
676
802
  <A extends object>(setupA: ExtensionSetup<A>): UseQueryResult<QueryClient & A>;
@@ -707,41 +833,6 @@ interface UseQueryClient {
707
833
  */
708
834
  declare const useQueryClient: UseQueryClient;
709
835
 
710
- /**
711
- * graz query hook to retrieve a CosmWasmClient, StargateClient and Tendermint34Client. If there's no given arguments it will be using the current connected client
712
- *
713
- * @example
714
- * ```ts
715
- * import { useClient } from "graz";
716
- *
717
- * // use connected client's cosmwasm client
718
- * const { data, isFetching, refetch, ... } = useClient();
719
- *
720
- * // initialize new custom client from given arguments
721
- * useClient({ rpc: "https://rpc.cosmoshub.strange.love", });
722
- * ```
723
- */
724
- declare const useClients: (args?: CreateClientArgs) => UseQueryResult<GrazStore["clients"]>;
725
- /**
726
- * graz query hook to retrieve a SigningCosmWasmClient. If there's no given args it will be using the current connected signer
727
- *
728
- * @example
729
- * ```ts
730
- * import { useSigningClient } from "graz";
731
- *
732
- * // get connected client's cosmwasm client
733
- * const { data, isFetching, refetch, ... } = useSigningClient();
734
- *
735
- * // initialize new custom client with given args
736
- * useSigningClient({
737
- * rpc: "https://rpc.cosmoshub.strange.love",
738
- * offlineSigner: customOfflineSigner,
739
- * ...
740
- * });
741
- * ```
742
- */
743
- declare const useSigningClients: (args?: CreateSigningClientArgs) => UseQueryResult<GrazStore["signingClients"]>;
744
-
745
836
  /**
746
837
  * graz mutation hook to send tokens. Note: if `senderAddress` undefined, it will use current connected account address.
747
838
  *
@@ -894,6 +985,7 @@ declare const useCheckWallet: (type?: WalletType) => UseQueryResult<boolean>;
894
985
 
895
986
  type GrazProviderProps = Partial<QueryClientProviderProps> & {
896
987
  grazOptions?: ConfigureGrazArgs;
988
+ debug?: boolean;
897
989
  };
898
990
  /**
899
991
  * Provider component which extends `@tanstack/react-query`'s {@link QueryClientProvider} with built-in query client
@@ -916,7 +1008,7 @@ type GrazProviderProps = Partial<QueryClientProviderProps> & {
916
1008
  declare const GrazProvider: FC<GrazProviderProps>;
917
1009
 
918
1010
  /**
919
- * Graz custom hook to track `keplr_keystorechange` event and reconnect state
1011
+ * Graz custom hook to track `keplr_keystorechange`, `leap_keystorechange`, `accountChanged` event and reconnect state
920
1012
  *
921
1013
  * **Note: only use this hook if not using graz's provider component.**
922
1014
  */
@@ -928,588 +1020,4 @@ declare const useGrazEvents: () => null;
928
1020
  */
929
1021
  declare const GrazEvents: FC;
930
1022
 
931
- /**
932
- * Asset lists are a similar mechanism to allow frontends and other UIs to fetch metadata
933
- * associated with Cosmos SDK denoms, especially for assets sent over IBC.
934
- */
935
- interface AssetList {
936
- $schema?: string;
937
- assets: Asset[];
938
- chain_name: string;
939
- }
940
- interface Asset {
941
- /**
942
- * [OPTIONAL] The address of the asset. Only required for type_asset : cw20, snip20
943
- */
944
- address?: string;
945
- /**
946
- * The base unit of the asset. Must be in denom_units.
947
- */
948
- base: string;
949
- /**
950
- * [OPTIONAL] The coingecko id to fetch asset data from coingecko v3 api. See
951
- * https://api.coingecko.com/api/v3/coins/list
952
- */
953
- coingecko_id?: string;
954
- denom_units: DenomUnit[];
955
- /**
956
- * [OPTIONAL] A short description of the asset
957
- */
958
- description?: string;
959
- /**
960
- * The human friendly unit of the asset. Must be in denom_units.
961
- */
962
- display: string;
963
- /**
964
- * [OPTIONAL] IBC Channel between src and dst between chain
965
- */
966
- ibc?: Ibc;
967
- images?: AssetImage[];
968
- keywords?: string[];
969
- logo_URIs?: AssetLogoURIs;
970
- /**
971
- * The project name of the asset. For example Bitcoin.
972
- */
973
- name: string;
974
- /**
975
- * The symbol of an asset. For example BTC.
976
- */
977
- symbol: string;
978
- /**
979
- * The origin of the asset, starting with the index, and capturing all transitions in form
980
- * and location.
981
- */
982
- traces?: Trace[];
983
- /**
984
- * [OPTIONAL] The potential options for type of asset. By default, assumes sdk.coin
985
- */
986
- type_asset?: TypeAsset;
987
- }
988
- interface DenomUnit {
989
- aliases?: string[];
990
- denom: string;
991
- exponent: number;
992
- }
993
- /**
994
- * [OPTIONAL] IBC Channel between src and dst between chain
995
- */
996
- interface Ibc {
997
- dst_channel: string;
998
- source_channel: string;
999
- source_denom: string;
1000
- }
1001
- interface AssetImage {
1002
- png?: string;
1003
- svg?: string;
1004
- theme?: Theme;
1005
- }
1006
- interface Theme {
1007
- primary_color_hex?: string;
1008
- }
1009
- interface AssetLogoURIs {
1010
- png?: string;
1011
- svg?: string;
1012
- }
1013
- interface Trace {
1014
- chain?: TraceChain;
1015
- counterparty: Counterparty;
1016
- /**
1017
- * The entity offering the service. E.g., 'Gravity Bridge' [Network] or 'Tether' [Company].
1018
- */
1019
- provider?: string;
1020
- type: TraceType;
1021
- }
1022
- interface TraceChain {
1023
- /**
1024
- * The chain's IBC transfer channel(, e.g., 'channel-1').
1025
- */
1026
- channel_id?: string;
1027
- /**
1028
- * The contract address where the transition takes place, where applicable. E.g., The
1029
- * Ethereum contract that locks up the asset while it's minted on another chain.
1030
- */
1031
- contract?: string;
1032
- /**
1033
- * The port/channel/denom input string that generates the 'ibc/...' denom.
1034
- */
1035
- path?: string;
1036
- /**
1037
- * The port used to transfer IBC assets; often 'transfer', but sometimes varies, e.g., for
1038
- * outgoing cw20 transfers.
1039
- */
1040
- port?: string;
1041
- }
1042
- interface Counterparty {
1043
- /**
1044
- * The base unit of the asset on its source platform. E.g., when describing ATOM from Cosmos
1045
- * Hub, specify 'uatom', NOT 'atom' nor 'ATOM'; base units are unique per platform.
1046
- */
1047
- base_denom: string;
1048
- /**
1049
- * The name of the counterparty chain. (must match exactly the chain name used in the Chain
1050
- * Registry)
1051
- *
1052
- * The chain or platform from which the asset originates. E.g., 'cosmoshub', 'ethereum',
1053
- * 'forex', or 'nasdaq'
1054
- */
1055
- chain_name: string;
1056
- /**
1057
- * The counterparty IBC transfer channel(, e.g., 'channel-1').
1058
- */
1059
- channel_id?: string;
1060
- /**
1061
- * The contract address where the transition takes place, where applicable. E.g., The
1062
- * Ethereum contract that locks up the asset while it's minted on another chain.
1063
- */
1064
- contract?: string;
1065
- /**
1066
- * The port used to transfer IBC assets; often 'transfer', but sometimes varies, e.g., for
1067
- * outgoing cw20 transfers.
1068
- */
1069
- port?: string;
1070
- }
1071
- declare enum TraceType {
1072
- Bridge = "bridge",
1073
- Ibc = "ibc",
1074
- IbcCw20 = "ibc-cw20",
1075
- LiquidStake = "liquid-stake",
1076
- Synthetic = "synthetic",
1077
- Wrapped = "wrapped"
1078
- }
1079
- /**
1080
- * [OPTIONAL] The potential options for type of asset. By default, assumes sdk.coin
1081
- */
1082
- declare enum TypeAsset {
1083
- Cw20 = "cw20",
1084
- Erc20 = "erc20",
1085
- Ics20 = "ics20",
1086
- SDKCoin = "sdk.coin",
1087
- Snip20 = "snip20",
1088
- Snip25 = "snip25"
1089
- }
1090
- /**
1091
- * Cosmos Chain.json is a metadata file that contains information about a cosmos sdk based
1092
- * chain.
1093
- */
1094
- interface Chain {
1095
- $schema?: string;
1096
- alternative_slip44s?: number[];
1097
- apis?: Apis;
1098
- /**
1099
- * Used to override the bech32_prefix for specific uses.
1100
- */
1101
- bech32_config?: Bech32Config;
1102
- /**
1103
- * The default prefix for the human-readable part of addresses that identifies the coin
1104
- * type. Must be registered with SLIP-0173. E.g., 'cosmos'
1105
- */
1106
- bech32_prefix: string;
1107
- chain_id: string;
1108
- chain_name: string;
1109
- codebase?: Codebase;
1110
- daemon_name?: string;
1111
- explorers?: Explorer[];
1112
- extra_codecs?: ExtraCodec[];
1113
- fees?: Fees;
1114
- images?: ChainImage[];
1115
- key_algos?: KeyAlgo[];
1116
- keywords?: string[];
1117
- logo_URIs?: ChainLogoURIs;
1118
- network_type?: NetworkType;
1119
- node_home?: string;
1120
- peers?: Peers;
1121
- pretty_name?: string;
1122
- slip44?: number;
1123
- staking?: Staking;
1124
- status?: Status;
1125
- update_link?: string;
1126
- website?: string;
1127
- }
1128
- interface Apis {
1129
- "evm-http-jsonrpc"?: Api[];
1130
- grpc?: Api[];
1131
- "grpc-web"?: Api[];
1132
- rest?: Api[];
1133
- rpc?: Api[];
1134
- wss?: Api[];
1135
- }
1136
- interface Api {
1137
- address: string;
1138
- archive?: boolean;
1139
- provider?: string;
1140
- }
1141
- /**
1142
- * Used to override the bech32_prefix for specific uses.
1143
- */
1144
- interface Bech32Config {
1145
- /**
1146
- * e.g., 'cosmos'
1147
- */
1148
- bech32PrefixAccAddr?: string;
1149
- /**
1150
- * e.g., 'cosmospub'
1151
- */
1152
- bech32PrefixAccPub?: string;
1153
- /**
1154
- * e.g., 'cosmosvalcons'
1155
- */
1156
- bech32PrefixConsAddr?: string;
1157
- /**
1158
- * e.g., 'cosmosvalconspub'
1159
- */
1160
- bech32PrefixConsPub?: string;
1161
- /**
1162
- * e.g., 'cosmosvaloper'
1163
- */
1164
- bech32PrefixValAddr?: string;
1165
- /**
1166
- * e.g., 'cosmosvaloperpub'
1167
- */
1168
- bech32PrefixValPub?: string;
1169
- }
1170
- interface Codebase {
1171
- binaries?: CodebaseBinaries;
1172
- compatible_versions?: string[];
1173
- consensus?: CodebaseConsensus;
1174
- cosmos_sdk_version?: string;
1175
- cosmwasm_enabled?: boolean;
1176
- /**
1177
- * Relative path to the cosmwasm directory. ex. $HOME/.juno/data/wasm
1178
- */
1179
- cosmwasm_path?: string;
1180
- cosmwasm_version?: string;
1181
- genesis?: Genesis;
1182
- git_repo?: string;
1183
- ibc_go_version?: string;
1184
- /**
1185
- * List of IBC apps (usually corresponding to a ICS standard) which have been enabled on the
1186
- * network.
1187
- */
1188
- ics_enabled?: ICSEnabled[];
1189
- recommended_version?: string;
1190
- versions?: Version[];
1191
- }
1192
- interface CodebaseBinaries {
1193
- "darwin/amd64"?: string;
1194
- "darwin/arm64"?: string;
1195
- "linux/amd64"?: string;
1196
- "linux/arm64"?: string;
1197
- "windows/amd64"?: string;
1198
- }
1199
- interface CodebaseConsensus {
1200
- type: ConsensusType;
1201
- version?: string;
1202
- }
1203
- declare enum ConsensusType {
1204
- Cometbft = "cometbft",
1205
- Tendermint = "tendermint"
1206
- }
1207
- interface Genesis {
1208
- genesis_url: string;
1209
- name?: string;
1210
- }
1211
- /**
1212
- * IBC app or ICS standard.
1213
- */
1214
- declare enum ICSEnabled {
1215
- Ics201 = "ics20-1",
1216
- Ics271 = "ics27-1",
1217
- Mauth = "mauth"
1218
- }
1219
- interface Version {
1220
- binaries?: VersionBinaries;
1221
- compatible_versions?: string[];
1222
- consensus?: VersionConsensus;
1223
- cosmos_sdk_version?: string;
1224
- cosmwasm_enabled?: boolean;
1225
- /**
1226
- * Relative path to the cosmwasm directory. ex. $HOME/.juno/data/wasm
1227
- */
1228
- cosmwasm_path?: string;
1229
- cosmwasm_version?: string;
1230
- /**
1231
- * Block Height
1232
- */
1233
- height?: number;
1234
- ibc_go_version?: string;
1235
- /**
1236
- * List of IBC apps (usually corresponding to a ICS standard) which have been enabled on the
1237
- * network.
1238
- */
1239
- ics_enabled?: ICSEnabled[];
1240
- /**
1241
- * Official Upgrade Name
1242
- */
1243
- name: string;
1244
- /**
1245
- * [Optional] Name of the following version
1246
- */
1247
- next_version_name?: string;
1248
- /**
1249
- * Proposal that will officially signal community acceptance of the upgrade.
1250
- */
1251
- proposal?: number;
1252
- recommended_version?: string;
1253
- /**
1254
- * Git Upgrade Tag
1255
- */
1256
- tag?: string;
1257
- }
1258
- interface VersionBinaries {
1259
- "darwin/amd64"?: string;
1260
- "darwin/arm64"?: string;
1261
- "linux/amd64"?: string;
1262
- "linux/arm64"?: string;
1263
- "windows/amd64"?: string;
1264
- }
1265
- interface VersionConsensus {
1266
- type: ConsensusType;
1267
- version?: string;
1268
- }
1269
- interface Explorer {
1270
- account_page?: string;
1271
- kind?: string;
1272
- tx_page?: string;
1273
- url?: string;
1274
- }
1275
- declare enum ExtraCodec {
1276
- Ethermint = "ethermint",
1277
- Injective = "injective"
1278
- }
1279
- interface Fees {
1280
- fee_tokens: FeeToken[];
1281
- }
1282
- interface FeeToken {
1283
- average_gas_price?: number;
1284
- denom: string;
1285
- fixed_min_gas_price?: number;
1286
- gas_costs?: GasCosts;
1287
- high_gas_price?: number;
1288
- low_gas_price?: number;
1289
- }
1290
- interface GasCosts {
1291
- cosmos_send?: number;
1292
- ibc_transfer?: number;
1293
- }
1294
- interface ChainImage {
1295
- png?: string;
1296
- svg?: string;
1297
- theme?: Theme;
1298
- }
1299
- declare enum KeyAlgo {
1300
- Ed25519 = "ed25519",
1301
- Ethsecp256K1 = "ethsecp256k1",
1302
- Secp256K1 = "secp256k1",
1303
- Sr25519 = "sr25519"
1304
- }
1305
- interface ChainLogoURIs {
1306
- png?: string;
1307
- svg?: string;
1308
- }
1309
- declare enum NetworkType {
1310
- Devnet = "devnet",
1311
- Mainnet = "mainnet",
1312
- Testnet = "testnet"
1313
- }
1314
- interface Peers {
1315
- persistent_peers?: PersistentPeer[];
1316
- seeds?: PersistentPeer[];
1317
- }
1318
- interface PersistentPeer {
1319
- address: string;
1320
- id: string;
1321
- provider?: string;
1322
- }
1323
- interface Staking {
1324
- lock_duration?: LockDuration;
1325
- staking_tokens: StakingToken[];
1326
- }
1327
- interface LockDuration {
1328
- /**
1329
- * The number of blocks for which the staked tokens are locked.
1330
- */
1331
- blocks?: number;
1332
- /**
1333
- * The approximate time for which the staked tokens are locked.
1334
- */
1335
- time?: string;
1336
- }
1337
- interface StakingToken {
1338
- denom: string;
1339
- }
1340
- declare enum Status {
1341
- Killed = "killed",
1342
- Live = "live",
1343
- Upcoming = "upcoming"
1344
- }
1345
- interface IbcDataSchema {
1346
- $schema?: string;
1347
- chain_1: IbcDataSchemaChain;
1348
- chain_2: IbcDataSchemaChain;
1349
- channels: Channel[];
1350
- }
1351
- /**
1352
- * Top level IBC data pertaining to the chain. `chain_1` and `chain_2` should be in
1353
- * alphabetical order.
1354
- */
1355
- interface IbcDataSchemaChain {
1356
- chain_name: string;
1357
- /**
1358
- * The client ID on the corresponding chain representing the other chain's light client.
1359
- */
1360
- client_id: string;
1361
- /**
1362
- * The connection ID on the corresponding chain representing a connection to the other chain.
1363
- */
1364
- connection_id: string;
1365
- }
1366
- interface Channel {
1367
- chain_1: ChannelChain;
1368
- chain_2: ChannelChain;
1369
- /**
1370
- * Human readable description of the channel.
1371
- */
1372
- description?: string;
1373
- /**
1374
- * Determines if packets from a sending module must be 'ordered' or 'unordered'.
1375
- */
1376
- ordering: Ordering;
1377
- /**
1378
- * Human readable key:value pairs that help describe and distinguish channels.
1379
- */
1380
- tags?: Tags;
1381
- /**
1382
- * IBC Version
1383
- */
1384
- version: string;
1385
- }
1386
- interface ChannelChain {
1387
- /**
1388
- * The channel ID on the corresponding chain's connection representing a channel on the
1389
- * other chain.
1390
- */
1391
- channel_id: string;
1392
- /**
1393
- * The IBC port ID which a relevant module binds to on the corresponding chain.
1394
- */
1395
- port_id: string;
1396
- }
1397
- /**
1398
- * Determines if packets from a sending module must be 'ordered' or 'unordered'.
1399
- */
1400
- declare enum Ordering {
1401
- Ordered = "ordered",
1402
- Unordered = "unordered"
1403
- }
1404
- /**
1405
- * Human readable key:value pairs that help describe and distinguish channels.
1406
- */
1407
- interface Tags {
1408
- dex?: string;
1409
- preferred?: boolean;
1410
- /**
1411
- * String that helps describe non-dex use cases ex: interchain accounts(ICA).
1412
- */
1413
- properties?: string;
1414
- status?: Status;
1415
- [property: string]: any;
1416
- }
1417
- interface MemoKeysSchema {
1418
- $schema?: string;
1419
- memo_keys: MemoKey[];
1420
- }
1421
- interface MemoKey {
1422
- description: string;
1423
- git_repo: string;
1424
- key: string;
1425
- memo: Record<string, any>;
1426
- [property: string]: any;
1427
- }
1428
-
1429
- /**
1430
- * Helper function to define chain.
1431
- *
1432
- * This function does not do anything special else than providing type safety
1433
- * when defining chain information.
1434
- *
1435
- * @example
1436
- * ```ts
1437
- * import { defineAsset } from "graz";
1438
- *
1439
- * const atom = defineAsset({
1440
- * base: "uatom",
1441
- * display: "atom",
1442
- * symbol: "ATOM",
1443
- * ...
1444
- * });
1445
- * ```
1446
- */
1447
- declare const defineAsset: <T extends Asset>(asset: T) => T;
1448
- /**
1449
- * Helper function to define chains asset list.
1450
- *
1451
- * This function does not do anything special else than providing type safety
1452
- * when defining chain information.
1453
- *
1454
- * @example
1455
- * ```ts
1456
- * import { defineAssetList } from "graz";
1457
- *
1458
- * const assetlist = defineAssetList({
1459
- * chain_name: "cosmoshub",
1460
- * assets: [...]
1461
- * });
1462
- * ```
1463
- */
1464
- declare const defineAssetList: <T extends AssetList>(assetlist: T) => T;
1465
- /**
1466
- * Helper function to define chain with registry compliant type.
1467
- *
1468
- * This function does not do anything special else than providing type safety
1469
- * when defining chain information.
1470
- *
1471
- * @example
1472
- * ```ts
1473
- * import { defineRegistryChain } from "graz";
1474
- *
1475
- * const cosmoshub = defineRegistryChain({
1476
- * chain_name: "cosmoshub",
1477
- * chain_id: "cosmoshub-4",
1478
- * ...
1479
- * });
1480
- * ```
1481
- */
1482
- declare const defineRegistryChain: <T extends Chain>(chain: T) => T;
1483
-
1484
- /**
1485
- * Function to convert chain object from registry to Keplr's {@link ChainInfo} object.
1486
- *
1487
- * Note that every chain generated in `graz/chains` already has {@link ChainInfo}.
1488
- * (e.g. `import chainInfo from "graz/chains/cosmoshub"`).
1489
- *
1490
- * @example
1491
- * ```ts
1492
- * import { registryToChainInfo } from "graz";
1493
- *
1494
- * import chain from "graz/chains/cosmoshub/chain";
1495
- * import assetlist from "graz/chains/cosmoshub/assetlist";
1496
- *
1497
- * const chainInfo = registryToChainInfo({ chain, assetlist });
1498
- * const chainInfoFromAsset = registryToChainInfo({ chain, assets: assetlist.assets });
1499
- * ```
1500
- *
1501
- */
1502
- declare const registryToChainInfo: (args: RegistryToChainInfoArgs) => ChainInfo;
1503
- type MapEndpointGetters<T extends string> = Record<`get${Capitalize<T>}Endpoint`, (chain: Chain) => string>;
1504
- type RegistryToChainInfoArgs = Partial<MapEndpointGetters<"rpc" | "rest">> & ({
1505
- chain: Chain;
1506
- assetlists: AssetList[];
1507
- } | {
1508
- chain: Chain;
1509
- assetlist: AssetList;
1510
- } | {
1511
- chain: Chain;
1512
- assets: Asset[];
1513
- });
1514
-
1515
- export { AccountData, Api, Apis, Asset, AssetImage, AssetList, AssetLogoURIs, Bech32Config, Chain, ChainImage, ChainInfoWithPath, ChainLogoURIs, Channel, ChannelChain, Codebase, CodebaseBinaries, CodebaseConsensus, ConfigureGrazArgs, ConnectArgs, ConnectResult, Connector, ConsensusType, Counterparty, CreateClientArgs, CreateQueryClient, CreateSigningClientArgs, DenomUnit, Dictionary, ExecuteContractArgs, ExecuteContractMutationArgs, Explorer, ExtraCodec, FeeToken, Fees, GasCosts, Genesis, GrazAdapter, GrazChain, GrazEvents, GrazProvider, GrazProviderProps, ICSEnabled, Ibc, IbcDataSchema, IbcDataSchemaChain, InstantiateContractArgs, InstantiateContractMutationArgs, KeyAlgo, LockDuration, Maybe, MemoKey, MemoKeysSchema, NetworkType, Ordering, Peers, PersistentPeer, ReconnectArgs, SendIbcTokensArgs, SendTokensArgs, Staking, StakingToken, Status, SuggestChainAndConnectArgs, Tags, Theme, Trace, TraceChain, TraceType, TypeAsset, UseAccountArgs, UseConnectChainArgs, UseExecuteContractArgs, UseInstantiateContractArgs, UseQueryClient, UseSuggestChainAndConnectArgs, UseSuggestChainArgs, Version, VersionBinaries, VersionConsensus, WALLET_TYPES, WalletType, checkWallet, clearRecentChain, configureGraz, connect, createClients, createQueryClient, createSigningClients, defineAsset, defineAssetList, defineChain, defineChainInfo, defineChains, defineRegistryChain, disconnect, executeContract, getActiveChainCurrency, getAvailableWallets, getBalanceStaked, getBalances, getCosmostation, getKeplr, getLeap, getQueryRaw, getQuerySmart, getRecentChain, getWallet, instantiateContract, reconnect, registryToChainInfo, sendIbcTokens, sendTokens, suggestChain, suggestChainAndConnect, useAccount, useActiveChain, useActiveChainCurrency, useActiveChainValidators, useBalance, useBalanceStaked, useBalances, useCheckWallet, useClients, useConnect, useDisconnect, useExecuteContract, useGrazEvents, useInstantiateContract, useOfflineSigners, useQueryClient, useQueryRaw, useQuerySmart, useRecentChain, useSendIbcTokens, useSendTokens, useSigners, useSigningClients, useSuggestChain, useSuggestChainAndConnect };
1023
+ export { AccountData, ChainInfoWithPath, ConfigureGrazArgs, ConnectArgs, ConnectResult, Connector, CreateClientArgs, CreateQueryClient, CreateSigningClientArgs, Dictionary, ExecuteContractArgs, ExecuteContractMutationArgs, GetWalletConnectParams, GrazAdapter, GrazChain, GrazEvents, GrazProvider, GrazProviderProps, InstantiateContractArgs, InstantiateContractMutationArgs, Maybe, ReconnectArgs, SendIbcTokensArgs, SendTokensArgs, SuggestChainAndConnectArgs, UseAccountArgs, UseConnectChainArgs, UseExecuteContractArgs, UseInstantiateContractArgs, UseQueryClient, UseSuggestChainAndConnectArgs, UseSuggestChainArgs, WALLET_TYPES, Wallet, WalletType, checkWallet, clearRecentChain, configureGraz, connect, createClients, createQueryClient, createSigningClients, defineChain, defineChainInfo, defineChains, disconnect, executeContract, getActiveChainCurrency, getAvailableWallets, getBalanceStaked, getBalances, getCosmostation, getKeplr, getLeap, getQueryRaw, getQuerySmart, getRecentChain, getWCCosmostation, getWCKeplr, getWCLeap, getWallet, getWalletConnect, instantiateContract, mainnetChains, mainnetChainsArray, reconnect, sendIbcTokens, sendTokens, suggestChain, suggestChainAndConnect, testnetChains, testnetChainsArray, useAccount, useActiveChain, useActiveChainCurrency, useActiveChainValidators, useBalance, useBalanceStaked, useBalances, useCheckWallet, useClients, useConnect, useDisconnect, useExecuteContract, useGrazEvents, useInstantiateContract, useOfflineSigners, useQueryClient, useQueryRaw, useQuerySmart, useRecentChain, useSendIbcTokens, useSendTokens, useSigners, useSigningClients, useSuggestChain, useSuggestChainAndConnect };