@shelby-protocol/ethereum-kit 0.1.0 → 0.1.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.
- package/dist/react/index.d.ts +6 -33
- package/package.json +7 -2
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Network as Network$1, InputEntryFunctionData, InputTransactionPluginData, AnyRawTransaction, AccountAuthenticatorAbstraction, AccountAddress } from '@aptos-labs/ts-sdk';
|
|
2
2
|
import { ShelbyClient } from '@shelby-protocol/sdk/browser';
|
|
3
|
+
import { WalletClient, Transport, Chain, Account } from 'viem';
|
|
3
4
|
|
|
4
5
|
declare const Network: {
|
|
5
6
|
readonly SHELBYNET: Network$1.SHELBYNET;
|
|
@@ -7,63 +8,35 @@ declare const Network: {
|
|
|
7
8
|
type Network = (typeof Network)[keyof typeof Network];
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
account: {
|
|
15
|
-
address: `0x${string}`;
|
|
16
|
-
};
|
|
17
|
-
/** EIP-1193 request method - available on wagmi WalletClient */
|
|
18
|
-
request: (args: {
|
|
19
|
-
method: string;
|
|
20
|
-
params?: unknown[];
|
|
21
|
-
}) => Promise<unknown>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Input type for signing transactions with the Ethereum wallet.
|
|
11
|
+
* Ethereum wallet type from viem.
|
|
12
|
+
*
|
|
13
|
+
* This is the WalletClient type that wagmi's useWalletClient() returns.
|
|
14
|
+
* Compatible with RainbowKit, Web3Modal, ConnectKit, and other wagmi-based adapters.
|
|
25
15
|
*/
|
|
16
|
+
type EthereumWallet = WalletClient<Transport, Chain, Account>;
|
|
26
17
|
type SignTransactionInput = {
|
|
27
18
|
data: InputEntryFunctionData;
|
|
28
19
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Input type for submitting transactions with the Ethereum wallet.
|
|
31
|
-
*/
|
|
32
20
|
type SubmitTransactionInput = {
|
|
33
21
|
transaction: AnyRawTransaction;
|
|
34
22
|
senderAuthenticator: AccountAuthenticatorAbstraction;
|
|
35
23
|
} & InputTransactionPluginData;
|
|
36
|
-
/**
|
|
37
|
-
* Input type for signing and submitting transactions with the Ethereum wallet.
|
|
38
|
-
*/
|
|
39
24
|
type SignAndSubmitTransactionInput = {
|
|
40
25
|
data: InputEntryFunctionData;
|
|
41
26
|
} & InputTransactionPluginData;
|
|
42
|
-
/**
|
|
43
|
-
* Parameters type for the useStorageAccount hook.
|
|
44
|
-
*/
|
|
45
27
|
interface UseStorageAccountParams {
|
|
46
|
-
/** The Shelby client */
|
|
47
28
|
client: ShelbyClient;
|
|
48
|
-
/** The connected Ethereum wallet from wagmi's useWalletClient() */
|
|
49
29
|
wallet: EthereumWallet | null | undefined;
|
|
50
30
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Result type for the useStorageAccount hook.
|
|
53
|
-
*/
|
|
54
31
|
interface UseStorageAccountResult {
|
|
55
|
-
/** The derived Shelby storage account address */
|
|
56
32
|
storageAccountAddress: AccountAddress | null;
|
|
57
|
-
/** Sign a transaction for Shelby using the connected Ethereum wallet */
|
|
58
33
|
signTransaction: (params: SignTransactionInput) => Promise<{
|
|
59
34
|
authenticator: AccountAuthenticatorAbstraction;
|
|
60
35
|
rawTransaction: AnyRawTransaction;
|
|
61
36
|
}>;
|
|
62
|
-
/** Submit a transaction to Shelby */
|
|
63
37
|
submitTransaction: (params: SubmitTransactionInput) => Promise<{
|
|
64
38
|
hash: string;
|
|
65
39
|
}>;
|
|
66
|
-
/** Sign and submit a transaction to Shelby */
|
|
67
40
|
signAndSubmitTransaction: (params: SignAndSubmitTransactionInput) => Promise<{
|
|
68
41
|
hash: string;
|
|
69
42
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shelby-protocol/ethereum-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"happy-dom": "^20.0.10",
|
|
30
30
|
"react": "19.2.1",
|
|
31
31
|
"react-dom": "19.2.1",
|
|
32
|
+
"viem": "^2.0.0",
|
|
32
33
|
"rimraf": "^6.0.1",
|
|
33
34
|
"tsup": "^8.4.0",
|
|
34
35
|
"typescript": "^5.8.3",
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
40
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
41
|
+
"viem": "^2.0.0"
|
|
40
42
|
},
|
|
41
43
|
"peerDependenciesMeta": {
|
|
42
44
|
"react": {
|
|
@@ -44,6 +46,9 @@
|
|
|
44
46
|
},
|
|
45
47
|
"react-dom": {
|
|
46
48
|
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"viem": {
|
|
51
|
+
"optional": true
|
|
47
52
|
}
|
|
48
53
|
},
|
|
49
54
|
"dependencies": {
|