@ton/appkit-react 0.0.4 → 0.0.5-alpha.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 +11 -2
- package/dist/esm/features/network/hooks/use-block-number.js +18 -0
- package/dist/esm/features/network/hooks/use-block-number.js.map +1 -0
- package/dist/esm/features/network/index.js +1 -0
- package/dist/esm/features/network/index.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/features/network/hooks/use-block-number.d.ts +16 -0
- package/dist/types/features/network/hooks/use-block-number.d.ts.map +1 -0
- package/dist/types/features/network/index.d.ts +1 -0
- package/dist/types/features/network/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/network/hooks/use-block-number.ts +32 -0
- package/src/features/network/index.ts +1 -0
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
This file is auto-generated. Do not edit manually.
|
|
3
|
+
Changes will be overwritten when running the docs update script.
|
|
4
|
+
Source template: template/packages/appkit-react/README.md
|
|
5
|
+
-->
|
|
6
|
+
|
|
1
7
|
# @ton/appkit-react
|
|
2
8
|
|
|
3
9
|
React components and hooks for AppKit.
|
|
@@ -164,7 +170,7 @@ npm install @ston-fi/omniston-sdk
|
|
|
164
170
|
Initialize `AppKit` with `OmnistonSwapProvider`:
|
|
165
171
|
|
|
166
172
|
```ts
|
|
167
|
-
// Initialize AppKit with swap
|
|
173
|
+
// Initialize AppKit with swap providers
|
|
168
174
|
const appKit = new AppKit({
|
|
169
175
|
networks: {
|
|
170
176
|
[Network.mainnet().chainId]: {
|
|
@@ -176,10 +182,13 @@ const appKit = new AppKit({
|
|
|
176
182
|
},
|
|
177
183
|
providers: [
|
|
178
184
|
new OmnistonSwapProvider({
|
|
179
|
-
// Optional configuration
|
|
180
185
|
apiUrl: 'https://api.ston.fi',
|
|
181
186
|
defaultSlippageBps: 100, // 1%
|
|
182
187
|
}),
|
|
188
|
+
new DeDustSwapProvider({
|
|
189
|
+
defaultSlippageBps: 100,
|
|
190
|
+
referralAddress: 'EQ...', // Optional
|
|
191
|
+
}),
|
|
183
192
|
],
|
|
184
193
|
});
|
|
185
194
|
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { getBlockNumberQueryOptions } from '@ton/appkit/queries';
|
|
9
|
+
import { useAppKit } from '../../../hooks/use-app-kit';
|
|
10
|
+
import { useQuery } from '../../../libs/query';
|
|
11
|
+
/**
|
|
12
|
+
* Hook to get the current masterchain block number
|
|
13
|
+
*/
|
|
14
|
+
export const useBlockNumber = (parameters = {}) => {
|
|
15
|
+
const appKit = useAppKit();
|
|
16
|
+
return useQuery(getBlockNumberQueryOptions(appKit, parameters));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=use-block-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-block-number.js","sourceRoot":"","sources":["../../../../../src/features/network/hooks/use-block-number.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAU/C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC1B,aAAmD,EAAE,EACjB,EAAE;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,QAAQ,CAAC,0BAA0B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/network/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,QAAQ;AACR,OAAO,EAAE,WAAW,EAA8B,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAA6B,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAoC,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/network/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,QAAQ;AACR,OAAO,EAAE,cAAc,EAAgE,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,WAAW,EAA8B,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAA6B,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAoC,MAAM,6BAA6B,CAAC"}
|