@initia/interwovenkit-react 2.0.0-rc.2 → 2.0.0-rc.3

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,13 +1,23 @@
1
+ import { AccountData } from '@cosmjs/amino';
1
2
  import { AminoConverters } from '@cosmjs/stargate';
3
+ import { AminoSignResponse } from '@cosmjs/amino';
2
4
  import { Chain } from '@initia/initia-registry-types';
5
+ import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin';
6
+ import { CreateConnectorFn } from 'wagmi';
3
7
  import { DeliverTxResponse } from '@cosmjs/stargate';
8
+ import { EIP1193EventMap } from 'viem';
9
+ import { EIP1193RequestFn } from 'viem';
10
+ import { EIP1474Methods } from 'viem';
4
11
  import { EncodeObject } from '@cosmjs/proto-signing';
5
12
  import { GeneratedType } from '@cosmjs/proto-signing';
6
13
  import { IndexedTx } from '@cosmjs/stargate';
7
14
  import { JSX } from 'react/jsx-runtime';
15
+ import { OfflineAminoSigner } from '@cosmjs/amino';
8
16
  import { PropsWithChildren } from 'react';
9
- import { StdFee } from '@cosmjs/stargate';
17
+ import { SimulateResponse } from 'cosmjs-types/cosmos/tx/v1beta1/service';
18
+ import { StdSignDoc } from '@cosmjs/amino';
10
19
  import { UseQueryResult } from '@tanstack/react-query';
20
+ import { Wallet } from '@rainbow-me/rainbowkit';
11
21
  import { z } from 'zod';
12
22
 
13
23
  export declare const AddressUtils: {
@@ -28,6 +38,7 @@ declare interface Config {
28
38
  routerApiUrl: string;
29
39
  usernamesModuleAddress: string;
30
40
  theme: "light" | "dark";
41
+ container?: HTMLElement;
31
42
  }
32
43
 
33
44
  export declare function createUsernameClient({ restUrl, moduleAddress }: Params): {
@@ -89,6 +100,21 @@ declare const FormValuesSchema: z.ZodObject<{
89
100
  cosmosWalletName?: string | undefined;
90
101
  }>;
91
102
 
103
+ export declare const initiaPrivyWallet: () => Wallet;
104
+
105
+ export declare const initiaPrivyWalletConnector: CreateConnectorFn< {
106
+ on: <event extends keyof EIP1193EventMap>(event: event, listener: EIP1193EventMap[event]) => void;
107
+ removeListener: <event extends keyof EIP1193EventMap>(event: event, listener: EIP1193EventMap[event]) => void;
108
+ request: EIP1193RequestFn<EIP1474Methods>;
109
+ }, Record<string, unknown>, Record<string, unknown>>;
110
+
111
+ export declare const initiaPrivyWalletOptions: {
112
+ id: string;
113
+ name: string;
114
+ iconUrl: string;
115
+ iconBackground: string;
116
+ };
117
+
92
118
  export declare function injectStyles(css: string): void;
93
119
 
94
120
  export declare const InterwovenKit: ({ bridge }: {
@@ -99,6 +125,17 @@ export declare const InterwovenKitProvider: ({ children, ...config }: PropsWithC
99
125
 
100
126
  export declare const MAINNET: Config;
101
127
 
128
+ declare class OfflineSigner implements OfflineAminoSigner {
129
+ private address;
130
+ private signMessage;
131
+ constructor(address: string, signMessage: (message: string) => Promise<string>);
132
+ private cachedPublicKey;
133
+ private getCachedPublicKey;
134
+ private getPublicKey;
135
+ getAccounts(): Promise<readonly AccountData[]>;
136
+ signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse>;
137
+ }
138
+
102
139
  declare interface Params {
103
140
  restUrl: string;
104
141
  moduleAddress: string;
@@ -116,9 +153,10 @@ declare interface TxRequest {
116
153
  messages: EncodeObject[];
117
154
  memo?: string;
118
155
  chainId?: string;
119
- gasAdjustment?: number;
120
156
  gas?: number;
121
- fee?: StdFee | null;
157
+ gasAdjustment?: number;
158
+ gasPrices?: Coin[] | null;
159
+ spendCoins?: Coin[];
122
160
  /** Internal use only */
123
161
  internal?: boolean | string | number;
124
162
  }
@@ -131,6 +169,7 @@ export declare function useInitiaAddress(): string;
131
169
 
132
170
  export declare function useInterwovenKit(): {
133
171
  estimateGas: ({ messages, memo, chainId }: TxRequest) => Promise<number>;
172
+ simulateTx: ({ messages, memo, chainId }: TxRequest) => Promise<SimulateResponse>;
134
173
  requestTxSync: (txRequest: TxRequest) => Promise<string>;
135
174
  requestTxBlock: (txRequest: TxRequest) => Promise<DeliverTxResponse>;
136
175
  waitForTxConfirmation: ({ chainId, ...params }: {
@@ -143,6 +182,7 @@ export declare function useInterwovenKit(): {
143
182
  initiaAddress: string;
144
183
  hexAddress: string;
145
184
  username: string | null | undefined;
185
+ offlineSigner: OfflineSigner;
146
186
  openConnect: () => void;
147
187
  openWallet: () => void;
148
188
  openBridge: (defaultValues?: Partial<FormValues>) => void;