Skip to content

Commit 9d1dcd6

Browse files
committed
README and packages
1 parent 1973846 commit 9d1dcd6

File tree

5 files changed

+48
-70
lines changed

5 files changed

+48
-70
lines changed

README.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ This package contains React helpers for interacting with Bitte Wallet.
1010

1111
</p>
1212

13-
Example:
14-
You can check a [quick example of Simple Login](https://github.com/Mintbase/examples/tree/main/starter) using Next.js 14 and @mintbase-js/react
15-
16-
17-
[Check our Templates repository for Mintbase.js](https://github.com/Mintbase/templates)
18-
19-
[Live Demo](https://starter.mintbase.xyz/)
2013

2114
## Summary
2215

@@ -27,8 +20,6 @@ You can check a [quick example of Simple Login](https://github.com/Mintbase/exam
2720

2821
# Installing
2922

30-
`@bitte-ai/react relies on React and React Dom version v18.2.0 due to @near-wallet-selector/modal-ui`
31-
3223
### NPM:
3324

3425
```
@@ -52,30 +43,22 @@ pnpm install @near-wallet-selector/modal-ui
5243

5344
# BitteWalletContextProvider
5445

55-
the default way of interacting with Mintbase Wallet is using the BitteWalletContextProvider
46+
the default way of interacting with Bitte Wallet is using the BitteWalletContextProvider
5647

5748
{% code title="app.tsx" overflow="wrap" lineNumbers="true" %}
5849

5950
## properties:
6051

61-
**contractAddress** (optional): `If you set this it will connect the user using Limited Access Keys, set with your near contract address / your mintbase store address`
62-
6352
**network** : ` mainnet | testnet`
6453

65-
**callbackUrl** : `a valid https/http address to the user be sent after the transaction`
66-
67-
**onlyMbWallet** : `boolean, it sets up only MintbaseWallet or if false(default) MintbaseWallet + default wallets`
68-
6954
**additionalWallets** : `WalletModuleFactory[] extra wallets setup`
7055

7156
```typescript
7257
import "@near-wallet-selector/modal-ui/styles.css";
7358
import { BitteWalletContextProvider } from '@bitte-ai/react'
7459

7560
<BitteWalletContextProvider
76-
contractAddress="mycontract.mintbase1.near"
7761
network="mainnet"
78-
callbackUrl="https://www.mywebsite.com/callback"
7962
>
8063
<Component {...pageProps} />
8164
</BitteWalletContextProvider>

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
"author": "Bitte Team",
2929
"license": "MIT",
3030
"devDependencies": {
31-
"@testing-library/react": "latest",
32-
"@testing-library/user-event": "latest",
33-
"@types/react": "latest",
34-
"@types/react-dom": "latest",
35-
"tsup": "latest",
36-
"typescript": "latest",
37-
"rxjs": "latest"
31+
"@testing-library/react": "^16.2.0",
32+
"@testing-library/user-event": "^14.6.1",
33+
"@types/react": "^19.0.8",
34+
"@types/react-dom": "^19.0.3",
35+
"rxjs": "^7.8.1",
36+
"tsup": "^8.3.6",
37+
"typescript": "^5.7.3"
3838
},
3939
"optionalDependencies": {
4040
"fsevents": "*"
@@ -43,16 +43,16 @@
4343
"fsevents": false
4444
},
4545
"dependencies": {
46-
"@bitte-ai/wallet": "0.1.0-add-branch-release-and-injected-wallet-d4d511e",
47-
"@mintbase-js/data": "latest",
48-
"@mintbase-js/sdk": "latest",
49-
"@near-wallet-selector/core": "latest",
50-
"@near-wallet-selector/here-wallet": "latest",
51-
"@near-wallet-selector/meteor-wallet": "latest",
52-
"@near-wallet-selector/modal-ui": "latest",
53-
"@near-wallet-selector/my-near-wallet": "latest",
54-
"buffer": "latest",
55-
"react": "latest",
56-
"react-dom": "latest"
46+
"@bitte-ai/wallet": "0.7.2",
47+
"@mintbase-js/data": "^0.6.5",
48+
"@mintbase-js/sdk": "^0.6.5",
49+
"@near-wallet-selector/core": "^8.9.16",
50+
"@near-wallet-selector/here-wallet": "^8.9.16",
51+
"@near-wallet-selector/meteor-wallet": "^8.9.16",
52+
"@near-wallet-selector/modal-ui": "^8.9.16",
53+
"@near-wallet-selector/my-near-wallet": "^8.9.16",
54+
"buffer": "^6.0.3",
55+
"react": "^19.0.0",
56+
"react-dom": "^19.0.0"
5757
}
5858
}

pnpm-lock.yaml

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.DS_Store

0 Bytes
Binary file not shown.

src/wallet/bitte-wallet.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,29 @@ export const BitteWalletAuth = {
6161
},
6262
setupBitteWalletSelector: async (
6363
onlyBitteWallet = false,
64-
network?,
65-
contractAddress?,
64+
network?: 'testnet' | 'mainnet',
6665
options?: { additionalWallets?: Array<WalletModuleFactory> },
67-
successUrl?: string,
66+
contractAddress?: string,
6867
walletUrl?: string
6968
): Promise<WalletSelectorComponents> => {
7069

7170
if (onlyBitteWallet === false) {
7271
BitteWalletAuth.walletSelectorComponents.selector = await setupWalletSelector({
73-
network: network,
72+
network: network || 'mainnet',
7473
modules: [
75-
setupBitteWallet({
76-
walletUrl: walletUrl || walletUrls[network],
77-
successUrl: successUrl || window.location.href,
78-
failureUrl: successUrl || window.location.href,
79-
}),
74+
setupBitteWallet() as WalletModuleFactory<Wallet>,
8075
...(options?.additionalWallets || []),
8176
...SUPPORTED_NEAR_WALLETS,
8277
],
8378
});
8479
} else {
8580
BitteWalletAuth.walletSelectorComponents.selector = await setupWalletSelector({
8681

87-
network: network,
82+
network: network || 'mainnet',
8883
modules: [
8984
setupBitteWallet({
90-
walletUrl: walletUrl || walletUrls[network],
91-
}),
85+
walletUrl: walletUrl || walletUrls[network as 'mainnet' | 'testnet'],
86+
}) as WalletModuleFactory<Wallet>,
9287
...(options?.additionalWallets || []),
9388
],
9489
});

0 commit comments

Comments
 (0)