@initia/interwovenkit-react 2.0.0-rc.2 → 2.0.0-rc.4
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.cjs +2 -2
- package/dist/index.d.ts +43 -23
- package/dist/index.js +3374 -3026
- package/dist/styles.css +1 -1
- package/dist/styles.js +1 -1
- package/package.json +7 -5
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 {
|
|
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): {
|
|
@@ -41,20 +52,6 @@ export declare const DEFAULT_GAS_ADJUSTMENT = 1.4;
|
|
|
41
52
|
|
|
42
53
|
export declare const DEFAULT_GAS_PRICE_MULTIPLIER = 1.03;
|
|
43
54
|
|
|
44
|
-
export declare function formatAmount(value?: BigNumber.Value, options?: FormatAmountOptions): string;
|
|
45
|
-
|
|
46
|
-
export declare interface FormatAmountOptions extends FormatNumberOptions {
|
|
47
|
-
decimals?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare function formatNumber(value: BigNumber.Value, options?: FormatNumberOptions): string;
|
|
51
|
-
|
|
52
|
-
export declare interface FormatNumberOptions {
|
|
53
|
-
dp?: number;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export declare function formatPercent(value?: BigNumber.Value, fixed?: number): string;
|
|
57
|
-
|
|
58
55
|
declare type FormValues = z.infer<typeof FormValuesSchema>;
|
|
59
56
|
|
|
60
57
|
declare const FormValuesSchema: z.ZodObject<{
|
|
@@ -89,6 +86,21 @@ declare const FormValuesSchema: z.ZodObject<{
|
|
|
89
86
|
cosmosWalletName?: string | undefined;
|
|
90
87
|
}>;
|
|
91
88
|
|
|
89
|
+
export declare const initiaPrivyWallet: () => Wallet;
|
|
90
|
+
|
|
91
|
+
export declare const initiaPrivyWalletConnector: CreateConnectorFn< {
|
|
92
|
+
on: <event extends keyof EIP1193EventMap>(event: event, listener: EIP1193EventMap[event]) => void;
|
|
93
|
+
removeListener: <event extends keyof EIP1193EventMap>(event: event, listener: EIP1193EventMap[event]) => void;
|
|
94
|
+
request: EIP1193RequestFn<EIP1474Methods>;
|
|
95
|
+
}, Record<string, unknown>, Record<string, unknown>>;
|
|
96
|
+
|
|
97
|
+
export declare const initiaPrivyWalletOptions: {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
iconUrl: string;
|
|
101
|
+
iconBackground: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
92
104
|
export declare function injectStyles(css: string): void;
|
|
93
105
|
|
|
94
106
|
export declare const InterwovenKit: ({ bridge }: {
|
|
@@ -99,6 +111,17 @@ export declare const InterwovenKitProvider: ({ children, ...config }: PropsWithC
|
|
|
99
111
|
|
|
100
112
|
export declare const MAINNET: Config;
|
|
101
113
|
|
|
114
|
+
declare class OfflineSigner implements OfflineAminoSigner {
|
|
115
|
+
private address;
|
|
116
|
+
private signMessage;
|
|
117
|
+
constructor(address: string, signMessage: (message: string) => Promise<string>);
|
|
118
|
+
private cachedPublicKey;
|
|
119
|
+
private getCachedPublicKey;
|
|
120
|
+
private getPublicKey;
|
|
121
|
+
getAccounts(): Promise<readonly AccountData[]>;
|
|
122
|
+
signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse>;
|
|
123
|
+
}
|
|
124
|
+
|
|
102
125
|
declare interface Params {
|
|
103
126
|
restUrl: string;
|
|
104
127
|
moduleAddress: string;
|
|
@@ -106,19 +129,14 @@ declare interface Params {
|
|
|
106
129
|
|
|
107
130
|
export declare const TESTNET: Config;
|
|
108
131
|
|
|
109
|
-
export declare function toAmount(value?: BigNumber.Value, decimals?: number): string;
|
|
110
|
-
|
|
111
|
-
export declare function toQuantity(value?: BigNumber.Value, decimals?: number): string;
|
|
112
|
-
|
|
113
|
-
export declare function truncate(text?: string, [h, t]?: [number, number]): string;
|
|
114
|
-
|
|
115
132
|
declare interface TxRequest {
|
|
116
133
|
messages: EncodeObject[];
|
|
117
134
|
memo?: string;
|
|
118
135
|
chainId?: string;
|
|
119
|
-
gasAdjustment?: number;
|
|
120
136
|
gas?: number;
|
|
121
|
-
|
|
137
|
+
gasAdjustment?: number;
|
|
138
|
+
gasPrices?: Coin[] | null;
|
|
139
|
+
spendCoins?: Coin[];
|
|
122
140
|
/** Internal use only */
|
|
123
141
|
internal?: boolean | string | number;
|
|
124
142
|
}
|
|
@@ -131,6 +149,7 @@ export declare function useInitiaAddress(): string;
|
|
|
131
149
|
|
|
132
150
|
export declare function useInterwovenKit(): {
|
|
133
151
|
estimateGas: ({ messages, memo, chainId }: TxRequest) => Promise<number>;
|
|
152
|
+
simulateTx: ({ messages, memo, chainId }: TxRequest) => Promise<SimulateResponse>;
|
|
134
153
|
requestTxSync: (txRequest: TxRequest) => Promise<string>;
|
|
135
154
|
requestTxBlock: (txRequest: TxRequest) => Promise<DeliverTxResponse>;
|
|
136
155
|
waitForTxConfirmation: ({ chainId, ...params }: {
|
|
@@ -143,6 +162,7 @@ export declare function useInterwovenKit(): {
|
|
|
143
162
|
initiaAddress: string;
|
|
144
163
|
hexAddress: string;
|
|
145
164
|
username: string | null | undefined;
|
|
165
|
+
offlineSigner: OfflineSigner;
|
|
146
166
|
openConnect: () => void;
|
|
147
167
|
openWallet: () => void;
|
|
148
168
|
openBridge: (defaultValues?: Partial<FormValues>) => void;
|