@hybrd/types 0.7.5 → 0.7.6

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import { Abi } from \"abitype\"\nimport { providers } from \"ethers\"\nimport { Chain, Client as WagmiClient } from \"wagmi\"\n\nexport type CompiledContract = {\n abi: Abi\n bytecode: string\n}\n\nexport type DeployedContract = {\n address: string\n chainId: number\n} & CompiledContract\n\nexport type DeployTarget = \"test\" | \"prod\"\n\nexport type Deployment = {\n address: string\n deployer: string\n txHash: string\n blockHash: string\n blockNumber: number\n}\n\nexport type {\n TransactionReceipt as Receipt,\n TransactionResponse as Transaction,\n} from \"@ethersproject/providers\"\n\nexport type ProviderConfig = {\n hybridKey?: string\n}\n\nexport type WalletConnectorOpts = object // todo - what config is common to all wallet plugins?\nexport type WalletConnection = {\n client: WagmiClient\n hooks: WalletConnectionHooks\n Provider: React.FC<WalletConnectorOpts>\n}\n\nexport type WalletConnectionHooks = {\n useWallet: () => UseWallet\n}\n\nexport type UseWallet = {\n connect: () => void\n disconnect: () => void\n}\n\nexport type WalletConnectorConfig = {\n chains: Chain[]\n providers: providers.BaseProvider[]\n}\n\nexport type WalletConnector = (\n config: WalletConnectorConfig\n) => WalletConnection\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import { Abi } from \"abitype\"\nimport { Address } from \"@wagmi/core\"\nimport { providers } from \"ethers\"\nimport { Chain, Client as WagmiClient } from \"wagmi\"\n\nexport type CompiledContract = {\n abi: Abi\n bytecode: string\n}\n\nexport type DeployedContract = {\n address: `0x${string}`\n chainId: number\n} & CompiledContract\n\nexport type DeployTarget = \"test\" | \"prod\"\n\nexport type Deployment = {\n address: string\n deployer: string\n txHash: string\n blockHash: string\n blockNumber: number\n}\n\nexport type SendTransactionResult = {\n hash: `0x${string}`\n wait: providers.TransactionResponse[\"wait\"]\n}\n\nexport type {\n TransactionReceipt as Receipt,\n TransactionResponse as Transaction,\n} from \"@ethersproject/providers\"\n\nexport type ProviderConfig = {\n hybridKey?: string\n}\n\nexport type WalletConnectorOpts = object // todo - what config is common to all wallet plugins?\nexport type WalletConnection = {\n client: WagmiClient\n hooks: WalletConnectionHooks\n Provider: React.FC<WalletConnectorOpts>\n}\n\nexport type WalletConnectionHooks = {\n useWallet: () => UseWallet\n}\n\nexport type UseWallet = {\n readonly account: Address | undefined\n readonly isLoading: boolean\n readonly isConnected: boolean\n connect: () => void\n disconnect: () => void\n}\n\nexport type WalletConnectorConfig = {\n chains: Chain[]\n providers: providers.BaseProvider[]\n}\n\nexport type WalletConnector = (\n config: WalletConnectorConfig\n) => WalletConnection\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Abi } from 'abitype';
2
+ import { Address } from '@wagmi/core';
2
3
  import { providers } from 'ethers';
3
4
  import { Client, Chain } from 'wagmi';
4
5
  export { TransactionReceipt as Receipt, TransactionResponse as Transaction } from '@ethersproject/providers';
@@ -8,7 +9,7 @@ type CompiledContract = {
8
9
  bytecode: string;
9
10
  };
10
11
  type DeployedContract = {
11
- address: string;
12
+ address: `0x${string}`;
12
13
  chainId: number;
13
14
  } & CompiledContract;
14
15
  type DeployTarget = "test" | "prod";
@@ -19,6 +20,10 @@ type Deployment = {
19
20
  blockHash: string;
20
21
  blockNumber: number;
21
22
  };
23
+ type SendTransactionResult = {
24
+ hash: `0x${string}`;
25
+ wait: providers.TransactionResponse["wait"];
26
+ };
22
27
 
23
28
  type ProviderConfig = {
24
29
  hybridKey?: string;
@@ -33,6 +38,9 @@ type WalletConnectionHooks = {
33
38
  useWallet: () => UseWallet;
34
39
  };
35
40
  type UseWallet = {
41
+ readonly account: Address | undefined;
42
+ readonly isLoading: boolean;
43
+ readonly isConnected: boolean;
36
44
  connect: () => void;
37
45
  disconnect: () => void;
38
46
  };
@@ -42,4 +50,4 @@ type WalletConnectorConfig = {
42
50
  };
43
51
  type WalletConnector = (config: WalletConnectorConfig) => WalletConnection;
44
52
 
45
- export { CompiledContract, DeployTarget, DeployedContract, Deployment, ProviderConfig, UseWallet, WalletConnection, WalletConnectionHooks, WalletConnector, WalletConnectorConfig, WalletConnectorOpts };
53
+ export { CompiledContract, DeployTarget, DeployedContract, Deployment, ProviderConfig, SendTransactionResult, UseWallet, WalletConnection, WalletConnectionHooks, WalletConnector, WalletConnectorConfig, WalletConnectorOpts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybrd/types",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Solidity + TypeScript Framework for Web3 Development",
5
5
  "author": "Ian Hunter <ian@ianh.xyz>",
6
6
  "homepage": "https://github.com/hybridhq/hybrid#readme",
@@ -41,5 +41,5 @@
41
41
  "tsup": "^6.6.3",
42
42
  "typescript": "^4.9.5"
43
43
  },
44
- "gitHead": "5065a984fffb5e752f1d61af3b988dad15d00e37"
44
+ "gitHead": "88a2c6205a0c528a756fa4595ddd95796409b12e"
45
45
  }