@reown/appkit-utils 0.0.3
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/LICENSE +190 -0
- package/dist/esm/exports/ethers.js +3 -0
- package/dist/esm/exports/ethers.js.map +1 -0
- package/dist/esm/exports/index.js +5 -0
- package/dist/esm/exports/index.js.map +1 -0
- package/dist/esm/exports/solana.js +3 -0
- package/dist/esm/exports/solana.js.map +1 -0
- package/dist/esm/package.json +81 -0
- package/dist/esm/src/ConstantsUtil.js +21 -0
- package/dist/esm/src/ConstantsUtil.js.map +1 -0
- package/dist/esm/src/HelpersUtil.js +14 -0
- package/dist/esm/src/HelpersUtil.js.map +1 -0
- package/dist/esm/src/PresetsUtil.js +83 -0
- package/dist/esm/src/PresetsUtil.js.map +1 -0
- package/dist/esm/src/TypeUtil.js +11 -0
- package/dist/esm/src/TypeUtil.js.map +1 -0
- package/dist/esm/src/ethers/EthersConstantsUtil.js +6 -0
- package/dist/esm/src/ethers/EthersConstantsUtil.js.map +1 -0
- package/dist/esm/src/ethers/EthersHelpersUtil.js +63 -0
- package/dist/esm/src/ethers/EthersHelpersUtil.js.map +1 -0
- package/dist/esm/src/ethers/EthersStoreUtil.js +56 -0
- package/dist/esm/src/ethers/EthersStoreUtil.js.map +1 -0
- package/dist/esm/src/ethers/EthersTypesUtil.js +2 -0
- package/dist/esm/src/ethers/EthersTypesUtil.js.map +1 -0
- package/dist/esm/src/solana/SolanaConstantsUtil.js +31 -0
- package/dist/esm/src/solana/SolanaConstantsUtil.js.map +1 -0
- package/dist/esm/src/solana/SolanaHelpersUtils.js +61 -0
- package/dist/esm/src/solana/SolanaHelpersUtils.js.map +1 -0
- package/dist/esm/src/solana/SolanaTypesUtil.js +2 -0
- package/dist/esm/src/solana/SolanaTypesUtil.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/dist/types/exports/ethers.d.ts +3 -0
- package/dist/types/exports/index.d.ts +30 -0
- package/dist/types/exports/solana.d.ts +3 -0
- package/dist/types/src/ConstantsUtil.d.ts +18 -0
- package/dist/types/src/HelpersUtil.d.ts +4 -0
- package/dist/types/src/PresetsUtil.d.ts +9 -0
- package/dist/types/src/TypeUtil.d.ts +10 -0
- package/dist/types/src/ethers/EthersConstantsUtil.d.ts +5 -0
- package/dist/types/src/ethers/EthersHelpersUtil.d.ts +15 -0
- package/dist/types/src/ethers/EthersStoreUtil.d.ts +27 -0
- package/dist/types/src/ethers/EthersTypesUtil.d.ts +64 -0
- package/dist/types/src/solana/SolanaConstantsUtil.d.ts +22 -0
- package/dist/types/src/solana/SolanaHelpersUtils.d.ts +10 -0
- package/dist/types/src/solana/SolanaTypesUtil.d.ts +61 -0
- package/package.json +81 -0
- package/readme.md +11 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Connection as SolanaConnection, PublicKey, Transaction as SolanaWeb3Transaction, TransactionSignature, VersionedTransaction, SendOptions } from '@solana/web3.js';
|
|
2
|
+
import type { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
3
|
+
import type { CaipNetwork } from '@reown/appkit-common';
|
|
4
|
+
import type { ConnectorType } from '@reown/appkit-core';
|
|
5
|
+
import type { W3mFrameTypes } from '@reown/appkit-wallet';
|
|
6
|
+
export type Connection = SolanaConnection;
|
|
7
|
+
export interface ISolConfig {
|
|
8
|
+
providers: ProviderType;
|
|
9
|
+
defaultChain?: number;
|
|
10
|
+
SSR?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type ProviderType = {
|
|
13
|
+
injected?: Provider;
|
|
14
|
+
coinbase?: Provider;
|
|
15
|
+
email?: boolean;
|
|
16
|
+
EIP6963?: boolean;
|
|
17
|
+
metadata: Metadata;
|
|
18
|
+
};
|
|
19
|
+
export interface RequestArguments {
|
|
20
|
+
readonly method: string;
|
|
21
|
+
readonly params?: readonly unknown[] | object;
|
|
22
|
+
}
|
|
23
|
+
export interface Provider extends ProviderEventEmitterMethods {
|
|
24
|
+
name: string;
|
|
25
|
+
publicKey?: PublicKey;
|
|
26
|
+
icon?: string;
|
|
27
|
+
chains: CaipNetwork[];
|
|
28
|
+
type: ConnectorType;
|
|
29
|
+
connect: () => Promise<string>;
|
|
30
|
+
disconnect: () => Promise<void>;
|
|
31
|
+
signMessage: (message: Uint8Array) => Promise<Uint8Array>;
|
|
32
|
+
signTransaction: <T extends AnyTransaction>(transaction: T) => Promise<T>;
|
|
33
|
+
signAndSendTransaction: (transaction: AnyTransaction, options?: SendOptions) => Promise<TransactionSignature>;
|
|
34
|
+
sendTransaction: (transaction: AnyTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<TransactionSignature>;
|
|
35
|
+
signAllTransactions: <T extends AnyTransaction[]>(transactions: T) => Promise<T>;
|
|
36
|
+
}
|
|
37
|
+
export interface ProviderEventEmitterMethods {
|
|
38
|
+
on: <E extends ProviderEventEmitterMethods.Event>(event: E, listener: (data: ProviderEventEmitterMethods.EventParams[E]) => void) => void;
|
|
39
|
+
removeListener: <E extends ProviderEventEmitterMethods.Event>(event: E, listener: (data: ProviderEventEmitterMethods.EventParams[E]) => void) => void;
|
|
40
|
+
emit: <E extends ProviderEventEmitterMethods.Event>(event: E, data: ProviderEventEmitterMethods.EventParams[E]) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare namespace ProviderEventEmitterMethods {
|
|
43
|
+
type Event = keyof EventParams;
|
|
44
|
+
type EventParams = {
|
|
45
|
+
connect: PublicKey;
|
|
46
|
+
disconnect: undefined;
|
|
47
|
+
accountsChanged: PublicKey;
|
|
48
|
+
chainChanged: string;
|
|
49
|
+
auth_rpcRequest: W3mFrameTypes.RPCRequest;
|
|
50
|
+
auth_rpcSuccess: W3mFrameTypes.FrameEvent;
|
|
51
|
+
auth_rpcError: Error;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export type Metadata = {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
url: string;
|
|
58
|
+
icons: string[];
|
|
59
|
+
};
|
|
60
|
+
export type AnyTransaction = SolanaWeb3Transaction | VersionedTransaction;
|
|
61
|
+
export type GetActiveChain = () => CaipNetwork | undefined;
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reown/appkit-utils",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/esm/exports/index.js",
|
|
6
|
+
"types": "./dist/types/exports/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!tsconfig.tsbuildinfo"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/types/exports/index.d.ts",
|
|
14
|
+
"import": "./dist/esm/exports/index.js",
|
|
15
|
+
"default": "./dist/esm/exports/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./ethers": {
|
|
18
|
+
"types": "./dist/types/exports/ethers.d.ts",
|
|
19
|
+
"import": "./dist/esm/exports/ethers.js",
|
|
20
|
+
"default": "./dist/esm/exports/ethers.js"
|
|
21
|
+
},
|
|
22
|
+
"./solana": {
|
|
23
|
+
"types": "./dist/types/exports/solana.d.ts",
|
|
24
|
+
"import": "./dist/esm/exports/solana.js",
|
|
25
|
+
"default": "./dist/esm/exports/solana.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
"*": {
|
|
30
|
+
"ethers": [
|
|
31
|
+
"./dist/types/exports/ethers.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"solana": [
|
|
34
|
+
"./dist/types/exports/solana.d.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@walletconnect/universal-provider": "2.16.1",
|
|
40
|
+
"valtio": "1.11.2",
|
|
41
|
+
"@reown/appkit-common": "0.0.3",
|
|
42
|
+
"@reown/appkit-core": "0.0.3",
|
|
43
|
+
"@reown/appkit-polyfills": "0.0.3",
|
|
44
|
+
"@reown/appkit-wallet": "0.0.3"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@coinbase/wallet-sdk": "4.0.3",
|
|
48
|
+
"@solana/web3.js": "1.95.2",
|
|
49
|
+
"@solana/wallet-adapter-base": "0.9.23"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"valtio": "1.11.2"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"web3",
|
|
56
|
+
"crypto",
|
|
57
|
+
"ethereum",
|
|
58
|
+
"appkit",
|
|
59
|
+
"reown",
|
|
60
|
+
"utils",
|
|
61
|
+
"wagmi",
|
|
62
|
+
"ethers"
|
|
63
|
+
],
|
|
64
|
+
"author": "reown <reown.com>",
|
|
65
|
+
"license": "Apache-2.0",
|
|
66
|
+
"homepage": "https://github.com/web3modal/web3modal",
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "git+https://github.com/WalletConnect/shadow-appkit.git"
|
|
70
|
+
},
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/web3modal/web3modal/issues"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"build:clean": "rm -rf dist",
|
|
76
|
+
"build": "tsc --build",
|
|
77
|
+
"watch": "tsc --watch",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
|
|
80
|
+
}
|
|
81
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#### 📚 [Documentation](https://docs.walletconnect.com/2.0/web3modal/about)
|
|
2
|
+
|
|
3
|
+
#### 🔗 [Website](https://web3modal.com)
|
|
4
|
+
|
|
5
|
+
# Web3Modal
|
|
6
|
+
|
|
7
|
+
Your on-ramp to web3 multichain. Web3Modal is a versatile library that makes it super easy to connect users with your Dapp and start interacting with the blockchain.
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="./.github/assets/header.png" alt="" border="0">
|
|
11
|
+
</p>
|