@cordystackx/cordy_minikit 0.9.5 → 0.9.6
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 +78 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Licensed under the MIT License.
|
|
|
4
4
|
Unauthorized removal of this notice violates the license terms.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
# Github Official Repo
|
|
8
|
+
```bash
|
|
9
|
+
https://github.com/cordyStackX/cordy_minikit_official.git
|
|
10
|
+
```
|
|
7
11
|
|
|
8
12
|
# 🧩 cordy_minikit — Web3 Mini Kit by cordyStackX
|
|
9
13
|
|
|
@@ -62,8 +66,16 @@ root
|
|
|
62
66
|
|
|
63
67
|
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
# Get Started
|
|
70
|
+
|
|
71
|
+
## Setup
|
|
72
|
+
|
|
73
|
+
1. Install the NPM Packages
|
|
74
|
+
```bash
|
|
75
|
+
npm i @cordystackx/cordy_minikit@latest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. Create env file
|
|
67
79
|
```bash
|
|
68
80
|
NEXT_PUBLIC_RPC_ENDPOINT=
|
|
69
81
|
NEXT_PUBLIC_TOKENADDRESS=
|
|
@@ -71,27 +83,75 @@ NEXT_PUBLIC_PLATFORM_ADDRESS=
|
|
|
71
83
|
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
|
|
72
84
|
```
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
3. Create folder of /services/minikit/providers.ts
|
|
87
|
+
|
|
88
|
+
> Note: Make sure you install @tanstack/react-query for QueryClient and QueryClientProviders
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
"use client";
|
|
92
|
+
import { ReactNode } from "react";
|
|
76
93
|
import { ProvidersClientWrapper } from "@cordystackx/cordy_minikit";
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
95
|
+
|
|
96
|
+
const queryClient = new QueryClient();
|
|
97
|
+
|
|
98
|
+
export default function Providers({ children }: { children: ReactNode }) {
|
|
81
99
|
|
|
100
|
+
return(
|
|
101
|
+
<QueryClientProvider client={queryClient}>
|
|
102
|
+
<ProvidersClientWrapper>
|
|
103
|
+
{children}
|
|
104
|
+
</ProvidersClientWrapper>
|
|
105
|
+
</QueryClientProvider>
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
}
|
|
82
109
|
```
|
|
83
|
-
3. Use of Connect Buttons
|
|
84
|
-
```bash
|
|
85
|
-
import { ConnectWalletBT } from "@cordystackx/cordy_minikit";
|
|
86
|
-
|
|
87
|
-
<ConnectWalletBT/>
|
|
88
110
|
|
|
111
|
+
4. then import it both CSS Module into the /app/layout.tsx
|
|
112
|
+
```ts
|
|
113
|
+
|
|
114
|
+
import {
|
|
115
|
+
Providers
|
|
116
|
+
} from "@/app/services/minikit/providers";
|
|
117
|
+
import '@cordystackx/cordy_minikit/dist/css/UI_Comp/styles.module.css';
|
|
118
|
+
import '@cordystackx/cordy_minikit/dist/css/Buttons/styles.module.css';
|
|
119
|
+
|
|
120
|
+
export default function RootLayout({
|
|
121
|
+
children,
|
|
122
|
+
}: Readonly<{
|
|
123
|
+
children: React.ReactNode;
|
|
124
|
+
}>) {
|
|
125
|
+
return (
|
|
126
|
+
<html lang="en">
|
|
127
|
+
<body className={`${geistSans.variable} ${geistMono.variable}`}>
|
|
128
|
+
<Providers>
|
|
129
|
+
{children}
|
|
130
|
+
</Providers>
|
|
131
|
+
</body>
|
|
132
|
+
</html>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
89
135
|
```
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
136
|
+
|
|
137
|
+
## Usage
|
|
138
|
+
|
|
139
|
+
1. For Connect Buttons
|
|
140
|
+
```ts
|
|
141
|
+
import {
|
|
142
|
+
ConnectWalletBT
|
|
143
|
+
} from "@cordystackx/cordy_minikit";
|
|
144
|
+
|
|
145
|
+
<ConnectWalletBT />
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
2. For Button Transactions
|
|
149
|
+
```ts
|
|
150
|
+
import {
|
|
151
|
+
CordyStackTrans
|
|
152
|
+
} from "@cordystackx/cordy_minikit";
|
|
153
|
+
|
|
154
|
+
CordyStackTrans(address: string, cost: number)
|
|
95
155
|
|
|
96
156
|
```
|
|
97
157
|
|