@initia/interwovenkit-react 2.0.0 → 2.0.2
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/README.md +8 -17
- package/dist/index.cjs +2 -2
- package/dist/index.js +99 -95
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
InterwovenKit is a React library that provides components and hooks to connect dApps to Initia and Interwoven Rollups.
|
|
4
4
|
|
|
5
|
+
For detailed documentation, visit [https://docs.initia.xyz/interwovenkit](https://docs.initia.xyz/interwovenkit).
|
|
6
|
+
|
|
5
7
|
## Table of Contents
|
|
6
8
|
|
|
7
9
|
- [Features](#features)
|
|
@@ -120,38 +122,27 @@ Connect the wallet, check the balance, and send a transaction:
|
|
|
120
122
|
// page.tsx
|
|
121
123
|
"use client"
|
|
122
124
|
|
|
123
|
-
import { MsgSend } from "cosmjs-types/cosmos/bank/v1beta1/tx"
|
|
124
125
|
import { truncate } from "@initia/utils"
|
|
125
126
|
import { useInterwovenKit } from "@initia/interwovenkit-react"
|
|
126
127
|
|
|
127
128
|
export default function Home() {
|
|
128
|
-
const {
|
|
129
|
-
|
|
130
|
-
username,
|
|
131
|
-
openConnect,
|
|
132
|
-
openWallet,
|
|
133
|
-
openBridge,
|
|
134
|
-
requestTxSync,
|
|
135
|
-
waitForTxConfirmation,
|
|
136
|
-
} = useInterwovenKit()
|
|
129
|
+
const { address, username, openConnect, openWallet, openBridge, requestTxBlock } =
|
|
130
|
+
useInterwovenKit()
|
|
137
131
|
|
|
138
132
|
const send = async () => {
|
|
139
133
|
const messages = [
|
|
140
134
|
{
|
|
141
135
|
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
|
|
142
|
-
value:
|
|
136
|
+
value: {
|
|
143
137
|
fromAddress: address,
|
|
144
138
|
toAddress: address,
|
|
145
139
|
amount: [{ amount: "1000000", denom: "uinit" }],
|
|
146
|
-
}
|
|
140
|
+
},
|
|
147
141
|
},
|
|
148
142
|
]
|
|
149
143
|
|
|
150
|
-
const transactionHash = await
|
|
144
|
+
const { transactionHash } = await requestTxBlock({ messages })
|
|
151
145
|
console.log("Transaction sent:", transactionHash)
|
|
152
|
-
|
|
153
|
-
await waitForTxConfirmation({ txHash: transactionHash })
|
|
154
|
-
console.log("Transaction confirmed:", transactionHash)
|
|
155
146
|
}
|
|
156
147
|
|
|
157
148
|
const ETH = "move/edfcddacac79ab86737a1e9e65805066d8be286a37cb94f4884b892b0e39f954"
|
|
@@ -193,4 +184,4 @@ export default function Providers({ children }: PropsWithChildren) {
|
|
|
193
184
|
|
|
194
185
|
To migrate from `@initia/react-wallet-widget` v1.x to `@initia/interwovenkit-react`, see our official migration guide:
|
|
195
186
|
|
|
196
|
-
[https://
|
|
187
|
+
[https://docs.initia.xyz/interwovenkit/migration](https://docs.initia.xyz/interwovenkit/migration)
|