@kimafinance/kima-transaction-widget 1.2.82-beta.1 → 1.3.1-beta.1

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.
Files changed (121) hide show
  1. package/README.md +38 -69
  2. package/dist/Manrope-ExtraLight.eot +0 -0
  3. package/dist/Manrope-ExtraLight.woff +0 -0
  4. package/dist/Manrope-ExtraLight.woff2 +0 -0
  5. package/dist/SohneBreit-Buch.eot +0 -0
  6. package/dist/SohneBreit-Buch.woff +0 -0
  7. package/dist/SohneBreit-Buch.woff2 +0 -0
  8. package/dist/assets/Manrope-ExtraLight-47OLGDTA.woff +0 -0
  9. package/dist/assets/Manrope-ExtraLight-6BGXUBPE.woff2 +0 -0
  10. package/dist/assets/Manrope-ExtraLight-6KZAMPI7.eot +0 -0
  11. package/dist/assets/SohneBreit-Buch-FPHQDKKW.woff +0 -0
  12. package/dist/assets/SohneBreit-Buch-UDQP3HAK.woff2 +0 -0
  13. package/dist/assets/SohneBreit-Buch-VTQ4XGFE.eot +0 -0
  14. package/dist/index.cjs +6186 -0
  15. package/dist/index.cjs.map +1 -0
  16. package/dist/index.css +1890 -543
  17. package/dist/index.css.map +1 -0
  18. package/dist/index.js +5794 -13032
  19. package/dist/index.js.map +1 -1
  20. package/dist/metafile-cjs.json +1 -0
  21. package/dist/metafile-esm.json +1 -0
  22. package/package.json +77 -73
  23. package/dist/assets/icons/Arbitrum.d.ts +0 -7
  24. package/dist/assets/icons/Arrow.d.ts +0 -8
  25. package/dist/assets/icons/ArrowRight.d.ts +0 -8
  26. package/dist/assets/icons/Avalanche.d.ts +0 -7
  27. package/dist/assets/icons/BSC.d.ts +0 -7
  28. package/dist/assets/icons/BTC.d.ts +0 -7
  29. package/dist/assets/icons/Bank.d.ts +0 -7
  30. package/dist/assets/icons/Base.d.ts +0 -7
  31. package/dist/assets/icons/Bera.d.ts +0 -7
  32. package/dist/assets/icons/Celo.d.ts +0 -7
  33. package/dist/assets/icons/Check.d.ts +0 -8
  34. package/dist/assets/icons/Copy.d.ts +0 -8
  35. package/dist/assets/icons/Cross.d.ts +0 -8
  36. package/dist/assets/icons/Ethereum.d.ts +0 -7
  37. package/dist/assets/icons/Explorer.d.ts +0 -8
  38. package/dist/assets/icons/ExternalUrl.d.ts +0 -8
  39. package/dist/assets/icons/FooterLogo.d.ts +0 -8
  40. package/dist/assets/icons/Fuse.d.ts +0 -7
  41. package/dist/assets/icons/GoodDollar.d.ts +0 -7
  42. package/dist/assets/icons/KEUR.d.ts +0 -7
  43. package/dist/assets/icons/Minimize.d.ts +0 -8
  44. package/dist/assets/icons/Optimism.d.ts +0 -7
  45. package/dist/assets/icons/Polygon.d.ts +0 -7
  46. package/dist/assets/icons/Solana.d.ts +0 -7
  47. package/dist/assets/icons/Tron.d.ts +0 -7
  48. package/dist/assets/icons/USDC.d.ts +0 -7
  49. package/dist/assets/icons/USDT.d.ts +0 -7
  50. package/dist/assets/icons/Warning.d.ts +0 -7
  51. package/dist/assets/icons/index.d.ts +0 -28
  52. package/dist/assets/loading/180-ring.d.ts +0 -17
  53. package/dist/assets/loading/6-dots-scale.d.ts +0 -3
  54. package/dist/assets/loading/index.d.ts +0 -2
  55. package/dist/components/KimaTransactionWidget.d.ts +0 -31
  56. package/dist/components/TransactionWidget.d.ts +0 -6
  57. package/dist/components/TransferWidget.d.ts +0 -12
  58. package/dist/components/modals/AccountDetailsModal.d.ts +0 -5
  59. package/dist/components/modals/BankPopup.d.ts +0 -6
  60. package/dist/components/modals/HashPopup.d.ts +0 -7
  61. package/dist/components/modals/HelpPopup.d.ts +0 -3
  62. package/dist/components/modals/PendingTxPopup.d.ts +0 -6
  63. package/dist/components/modals/SolanaWalletConnectModal.d.ts +0 -3
  64. package/dist/components/modals/TronWalletConnectModal.d.ts +0 -3
  65. package/dist/components/modals/index.d.ts +0 -4
  66. package/dist/components/reusable/AddressInput.d.ts +0 -9
  67. package/dist/components/reusable/AddressInputWizard.d.ts +0 -3
  68. package/dist/components/reusable/BankInput.d.ts +0 -3
  69. package/dist/components/reusable/CoinDropdown.d.ts +0 -6
  70. package/dist/components/reusable/CoinSelect.d.ts +0 -3
  71. package/dist/components/reusable/ConfirmDetails.d.ts +0 -5
  72. package/dist/components/reusable/CopyButton.d.ts +0 -6
  73. package/dist/components/reusable/CustomCheckbox.d.ts +0 -8
  74. package/dist/components/reusable/Dropdown.d.ts +0 -7
  75. package/dist/components/reusable/ExpireTimeDropdown.d.ts +0 -3
  76. package/dist/components/reusable/ExternalLink.d.ts +0 -9
  77. package/dist/components/reusable/NetworkDropdown.d.ts +0 -6
  78. package/dist/components/reusable/NetworkLabel.d.ts +0 -8
  79. package/dist/components/reusable/NetworkSelect.d.ts +0 -6
  80. package/dist/components/reusable/PrimaryButton.d.ts +0 -11
  81. package/dist/components/reusable/Progressbar.d.ts +0 -10
  82. package/dist/components/reusable/SecondaryButton.d.ts +0 -11
  83. package/dist/components/reusable/SingleForm.d.ts +0 -6
  84. package/dist/components/reusable/SolanaWalletSelect.d.ts +0 -3
  85. package/dist/components/reusable/StepBox.d.ts +0 -10
  86. package/dist/components/reusable/TronWalletSelect.d.ts +0 -3
  87. package/dist/components/reusable/TxButton.d.ts +0 -7
  88. package/dist/components/reusable/WalletButton.d.ts +0 -5
  89. package/dist/components/reusable/index.d.ts +0 -18
  90. package/dist/helpers/fetch-wrapper.d.ts +0 -7
  91. package/dist/helpers/functions.d.ts +0 -4
  92. package/dist/hooks/useAllowance.d.ts +0 -9
  93. package/dist/hooks/useBalance.d.ts +0 -3
  94. package/dist/hooks/useCurrencyOptions.d.ts +0 -3
  95. package/dist/hooks/useGetSolBalance.d.ts +0 -2
  96. package/dist/hooks/useIsWalletReady.d.ts +0 -7
  97. package/dist/hooks/useNetworkOptions.d.ts +0 -3
  98. package/dist/hooks/usePendingTx.d.ts +0 -7
  99. package/dist/hooks/useServiceFee.d.ts +0 -3
  100. package/dist/hooks/useSign.d.ts +0 -6
  101. package/dist/hooks/useWidth.d.ts +0 -2
  102. package/dist/index.d.ts +0 -10
  103. package/dist/index.modern.js +0 -12725
  104. package/dist/index.modern.js.map +0 -1
  105. package/dist/interface.d.ts +0 -76
  106. package/dist/setupTests.d.ts +0 -1
  107. package/dist/store/index.d.ts +0 -3
  108. package/dist/store/optionSlice.d.ts +0 -4024
  109. package/dist/store/selectors.d.ts +0 -52
  110. package/dist/tronweb.d.ts +0 -2
  111. package/dist/utils/btc/htlc.d.ts +0 -8
  112. package/dist/utils/btc/utils.d.ts +0 -15
  113. package/dist/utils/config.d.ts +0 -1
  114. package/dist/utils/constants.d.ts +0 -108
  115. package/dist/utils/functions.d.ts +0 -1
  116. package/dist/utils/solana/createAssociatedTokenAccountInstruction.d.ts +0 -2
  117. package/dist/utils/solana/createTransferInstruction.d.ts +0 -39
  118. package/dist/utils/solana/getAccountInfo.d.ts +0 -19
  119. package/dist/utils/solana/getAssociatedTokenAddress.d.ts +0 -2
  120. package/dist/utils/solana/getOrCreateAssociatedTokenAccount.d.ts +0 -2
  121. package/dist/utils/testId.d.ts +0 -1
package/README.md CHANGED
@@ -26,36 +26,33 @@ import {
26
26
  SupportNetworks,
27
27
  ColorModeOptions
28
28
  } from 'kima-transaction-widget'
29
- import 'kima-transaction-widget/dist/index.css'
30
29
 
31
30
  const App = () => {
32
31
  return (
33
- <KimaProvider>
32
+ <KimaProvider
33
+ walletConnectProjectId='e579511a495b5c312b572b036e60555a'
34
+ externalProvider={} // in case you want to provide an already connected wallet
35
+ >
34
36
  <KimaTransactionWidget
35
37
  theme={{
36
- colorMode: ColorModeOptions.light,
37
- fontSize: FontSizeOptions.medium
38
+ colorMode: ColorModeOptions.light
38
39
  }}
39
40
  mode={ModeOptions.payment}
40
- kimaBackendUrl='http://localhost:3001'
41
- kimaNodeProviderQuery='https://api.kima.network'
41
+ kimaBackendUrl='http://localhost:3001' // or your deployed backend instance
42
+ kimaExplorer='https://explorer.sardis.kima.network' // or explorer.kima.network for mainnet
42
43
  titleOption={{
43
44
  initialTitle: 'New Purchase'
44
45
  }}
45
46
  paymentTitleOption={{
46
47
  title:
47
- 'You can now purchase our NFT on Polygon, using funds from other chains.',
48
- style: {
49
- fontSize: '1.2em',
50
- fontWeight: '500',
51
- color: '#DDDDDD'
52
- }
48
+ 'You can now purchase our NFT on Polygon, using funds from other chains.'
53
49
  }}
54
50
  compliantOption={false}
55
51
  transactionOption={{
56
52
  targetChain: SupportNetworks.AVALANCHE,
57
53
  targetAddress: '0x67cc400c434F691Ed45e452dC8F2Baf0101a9B63',
58
- amount: 5
54
+ amount: 5,
55
+ currency: 'USDK'
59
56
  }}
60
57
  errorHandler={(e: any) => {
61
58
  console.log('error:', e)
@@ -86,19 +83,21 @@ import {
86
83
  ModeOptions,
87
84
  ColorModeOptions
88
85
  } from 'kima-transaction-widget'
89
- import 'kima-transaction-widget/dist/index.css'
90
86
 
91
87
  const App = () => {
92
88
  return (
93
- <KimaProvider>
89
+ <KimaProvider
90
+ walletConnectProjectId='e579511a495b5c312b572b036e60555a'
91
+ externalProvider={} // in case you want to provide an already connected wallet
92
+ >
94
93
  <KimaTransactionWidget
95
94
  theme={{
96
95
  colorMode: ColorModeOptions.light,
97
96
  fontSize: FontSizeOptions.medium
98
97
  }}
99
98
  mode={ModeOptions.bridge}
100
- kimaBackendUrl='http://localhost:3001'
101
- kimaNodeProviderQuery='https://api.kima.network'
99
+ kimaBackendUrl='http://localhost:3001' // or your deployed backend instance
100
+ kimaExplorer='https://explorer.sardis.kima.network' // or explorer.kima.network for mainnet
102
101
  compliantOption={false}
103
102
  errorHandler={(e: any) => {
104
103
  console.log('error:', e)
@@ -109,6 +108,8 @@ const App = () => {
109
108
  closeHandler={() => {
110
109
  console.log('closed')
111
110
  }}
111
+ excludedSourceNetworks={[SupportNetworks.SOLANA]} // exclude networks that your dapp doesn't support
112
+ excludedTargetNetworks={[SupportNetworks.SOLANA]}
112
113
  />
113
114
  </KimaProvider>
114
115
  )
@@ -129,7 +130,6 @@ import {
129
130
  ModeOptions,
130
131
  ColorModeOptions
131
132
  } from 'kima-transaction-widget'
132
- import 'kima-transaction-widget/dist/index.css'
133
133
 
134
134
  const App = () => {
135
135
  return (
@@ -140,8 +140,8 @@ const App = () => {
140
140
  fontSize: FontSizeOptions.medium
141
141
  }}
142
142
  mode={ModeOptions.status}
143
- kimaBackendUrl='http://localhost:3001'
144
- kimaNodeProviderQuery='https://api.kima.network'
143
+ kimaBackendUrl='http://localhost:3001' // or your deployed backend instance
144
+ kimaExplorer='https://explorer.sardis.kima.network' // or explorer.kima.network for mainnet
145
145
  txId={10}
146
146
  errorHandler={(e: any) => {
147
147
  console.log('error:', e)
@@ -174,8 +174,6 @@ Used to specify theme options of kima-transaction-widget.
174
174
  <KimaTransactionWidget
175
175
  theme={{
176
176
  colorMode: ColorModeOptions.light,
177
- fontSize: FontSizeOptions.medium,
178
- fontFamily: 'Sans Serif',
179
177
  backgroundColorLight: '#CCCCCC', // background color of widget when light mode
180
178
  backgroundColorDark: '#FFDDFF' // background color of widget when dark mode
181
179
  }}
@@ -205,45 +203,6 @@ Used to specify transaction index to keep tracking of it's status and progress u
205
203
  - Type: `boolean`
206
204
  - Default: `-1`
207
205
 
208
- ### `useFIAT`
209
-
210
- Used to specify fiat option usage.
211
-
212
- - Required: `false`
213
- - Type: `boolean`
214
- - Default: `false`
215
-
216
- ### `autoConnect`
217
-
218
- Used to specify automatiction connection of wallet providers like metamask, solana or tron wallets.
219
-
220
- - Required: `false`
221
- - Type: `boolean`
222
- - Default: `false`
223
-
224
- ### `dAppOption`
225
-
226
- Used to specify which dApp interacts with the widget
227
-
228
- - Required: `false`
229
- - Type: `DAppOptions`
230
- - Default: `DAppOptions.None`
231
-
232
- ```tsx
233
- export enum DAppOptions {
234
- None = 'none',
235
- LPAdd = 'LPAdd',
236
- LPDrain = 'LPDrain'
237
- }
238
- ```
239
-
240
- ### `provider`
241
-
242
- Used to specify web3 wallet provider to share with dApp which implemented kima-transaction-widget
243
-
244
- - Required: `false`
245
- - Type: `Web3Provider`
246
-
247
206
  ### `titleOption`
248
207
 
249
208
  Used to specify title of widget. Consists of titles for each step of widget.
@@ -295,7 +254,8 @@ Used to specify payment scenario option.
295
254
  transactionOption={{
296
255
  targetChain: SupportNetworks.AVALANCHE, // target chain to receive payment
297
256
  targetAddress: '0x8222ADB2A2092c3774105a5F558987265D920C09', // target address to receive payment
298
- amount: 5 // USDT amount to receive payment
257
+ amount: 5 // token amount to receive payment
258
+ currency: 'USDK' // token to be used (default as USDK for testnet)
299
259
  }}
300
260
  />
301
261
  ```
@@ -328,13 +288,6 @@ Used to specify kima transaction backend url.
328
288
  - Required: `true`
329
289
  - Type: `string`
330
290
 
331
- ### `kimaNodeProviderQuery`
332
-
333
- Used to specify REST API url for kima blockchain.
334
-
335
- - Required: `true`
336
- - Type: `string`
337
-
338
291
  ### `kimaExplorer`
339
292
 
340
293
  Used to specify url of kima block explorer.
@@ -359,6 +312,7 @@ Used to specify url of kima block explorer.
359
312
  <KimaProvider
360
313
  walletConnectProjectId='e579511a495b5c312b572b036e60555a'
361
314
  networkOption={NetworkOptions.testnet}
315
+ externalProvider={new Web3Provider()}
362
316
  >
363
317
  {/ * etc */}
364
318
  </KimaProvider>
@@ -388,6 +342,21 @@ enum NetworkOptions {
388
342
  - Type: `NetworkOptions`
389
343
  - Default: `NetworkOptions.testnet`
390
344
 
345
+ ### `externalProvider`
346
+
347
+ Used to provide an already connected wallet instance from your app. Depending on the network your dapp is currently connected to is the instance that you will need to provide.
348
+
349
+ ```ts
350
+ interface ExternalProvider {
351
+ type: 'evm' | 'solana' | 'tron'
352
+ provider: Web3Provider | SolProvider | TronProvider
353
+ signer: JsonRpcSigner | PublicKey | string
354
+ }
355
+ ```
356
+
357
+ - Required: `false`
358
+ - Type: `ExternalProvider`
359
+
391
360
  ## Note
392
361
 
393
362
  [How to fix Polyfill node core module error](https://www.alchemy.com/blog/how-to-polyfill-node-core-modules-in-webpack-5)
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file