rise-wallet 0.1.0
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 +49 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +44 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# rise-wallet-sdk
|
|
2
|
+
|
|
3
|
+
Typescript SDK to integrate RISE wallet into your dApp.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Install porto, wagmi and the RISE wallet SDK:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install porto wagmi rise-wallet
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Use the rise config when instantiating porto:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { riseTestnetConfig, riseTestnet } from 'rise-wallet';
|
|
17
|
+
import { createConfig, http } from 'wagmi';
|
|
18
|
+
import { porto } from 'porto/wagmi';
|
|
19
|
+
|
|
20
|
+
export const config = createConfig({
|
|
21
|
+
chains: [riseTestnet],
|
|
22
|
+
connectors: [porto(riseTestnetConfig)],
|
|
23
|
+
transports: {
|
|
24
|
+
[riseTestnet.id]: http()
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. Use wagmi as usual
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { useConnect, useConnectors } from 'wagmi'
|
|
33
|
+
|
|
34
|
+
function Connect() {
|
|
35
|
+
const connect = useConnect()
|
|
36
|
+
const connectors = useConnectors()
|
|
37
|
+
|
|
38
|
+
return connectors?.map((connector) => (
|
|
39
|
+
<button
|
|
40
|
+
key={connector.uid}
|
|
41
|
+
onClick={() => connect.connect({ connector })}
|
|
42
|
+
>
|
|
43
|
+
Connect
|
|
44
|
+
</button>
|
|
45
|
+
))
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
RISE wallet is powered by Porto under the hood. For more information on its usage, refer to the [Porto docs](https://porto.sh)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const riseTestnetConfig: {
|
|
2
|
+
chains: unknown
|
|
3
|
+
transports: {}
|
|
4
|
+
};
|
|
5
|
+
import { Chain } from "porto/Chains";
|
|
6
|
+
declare function define<const chain extends Chain>(chain: chain): chain;
|
|
7
|
+
declare const riseTestnet: unknown;
|
|
8
|
+
export { riseTestnetConfig, riseTestnet, define };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/config.ts
|
|
2
|
+
import { defaultConfig } from "porto/Porto";
|
|
3
|
+
|
|
4
|
+
// src/chain.ts
|
|
5
|
+
import { riseTestnet as riseTestnetChain } from "viem/chains";
|
|
6
|
+
function define(chain) {
|
|
7
|
+
return chain;
|
|
8
|
+
}
|
|
9
|
+
var riseTestnet = /* @__PURE__ */ define({
|
|
10
|
+
...riseTestnetChain,
|
|
11
|
+
contracts: {
|
|
12
|
+
...riseTestnetChain.contracts,
|
|
13
|
+
portoAccount: {
|
|
14
|
+
address: "0x912a428b1a7e7cb7bb2709a2799a01c020c5acd9"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
rpcUrls: {
|
|
18
|
+
default: {
|
|
19
|
+
http: [
|
|
20
|
+
"https://rise-testnet-porto.fly.dev",
|
|
21
|
+
...riseTestnetChain.rpcUrls.default.http
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// src/config.ts
|
|
28
|
+
import { Mode } from "porto";
|
|
29
|
+
import { http } from "viem";
|
|
30
|
+
var riseTestnetConfig = {
|
|
31
|
+
...defaultConfig,
|
|
32
|
+
chains: [riseTestnet],
|
|
33
|
+
mode: Mode.dialog({
|
|
34
|
+
host: "https://rise-wallet-testnet.vercel.app/dialog"
|
|
35
|
+
}),
|
|
36
|
+
transports: {
|
|
37
|
+
[riseTestnet.id]: http()
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
riseTestnetConfig,
|
|
42
|
+
riseTestnet,
|
|
43
|
+
define
|
|
44
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rise-wallet",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/bun": "latest",
|
|
20
|
+
"bunup": "^0.9.2",
|
|
21
|
+
"bumpp": "^10.2.2"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"typescript": "^5",
|
|
25
|
+
"porto": "^0.0.58",
|
|
26
|
+
"viem": "^2.33.2"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "bunup",
|
|
30
|
+
"dev": "bunup --watch",
|
|
31
|
+
"release": "bumpp --commit --push --tag"
|
|
32
|
+
}
|
|
33
|
+
}
|