@gitmyabi/basewallet 1.0.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.
@@ -0,0 +1,127 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * Proxy_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const Proxy_jsonAbi: readonly [{
8
+ readonly inputs: readonly [{
9
+ readonly name: "_implementation";
10
+ readonly type: "address";
11
+ }];
12
+ readonly payable: false;
13
+ readonly stateMutability: "nonpayable";
14
+ readonly type: "constructor";
15
+ }, {
16
+ readonly payable: true;
17
+ readonly stateMutability: "payable";
18
+ readonly type: "fallback";
19
+ }, {
20
+ readonly anonymous: false;
21
+ readonly inputs: readonly [{
22
+ readonly indexed: true;
23
+ readonly name: "value";
24
+ readonly type: "uint256";
25
+ }, {
26
+ readonly indexed: true;
27
+ readonly name: "sender";
28
+ readonly type: "address";
29
+ }, {
30
+ readonly indexed: false;
31
+ readonly name: "data";
32
+ readonly type: "bytes";
33
+ }];
34
+ readonly name: "Received";
35
+ readonly type: "event";
36
+ }];
37
+ /**
38
+ * Type-safe ABI for Proxy_json
39
+ */
40
+ export type Proxy_jsonAbi = typeof Proxy_jsonAbi;
41
+ /**
42
+ * Contract instance type for Proxy_json
43
+ */
44
+ export type Proxy_jsonContract = any;
45
+ /**
46
+ * Proxy_json Contract Class
47
+ *
48
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * import { createPublicClient, createWalletClient, http } from 'viem';
53
+ * import { mainnet } from 'viem/chains';
54
+ * import { Proxy_json } from 'Proxy_json';
55
+ *
56
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
57
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
58
+ *
59
+ * const contract = new Proxy_json('0x...', { publicClient, walletClient });
60
+ *
61
+ * // Read functions
62
+ * const result = await contract.balanceOf('0x...');
63
+ *
64
+ * // Write functions
65
+ * const hash = await contract.transfer('0x...', 1000n);
66
+ *
67
+ * // Simulate transactions (dry-run)
68
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
69
+ * console.log('Gas estimate:', simulation.request.gas);
70
+ *
71
+ * // Watch events
72
+ * const unwatch = contract.watch.Transfer((event) => {
73
+ * console.log('Transfer event:', event);
74
+ * });
75
+ * ```
76
+ */
77
+ export declare class Proxy_json {
78
+ private contract;
79
+ private contractAddress;
80
+ private publicClient;
81
+ constructor(address: Address, clients: {
82
+ publicClient: PublicClient;
83
+ walletClient?: WalletClient;
84
+ });
85
+ /**
86
+ * Get the contract address
87
+ */
88
+ get address(): Address;
89
+ /**
90
+ * Get the underlying viem contract instance
91
+ */
92
+ getContract(): Proxy_jsonContract;
93
+ /**
94
+ * Simulate contract write operations (dry-run without sending transaction)
95
+ *
96
+ * Note: This contract has no write functions, so simulate returns an empty object.
97
+ */
98
+ get simulate(): {};
99
+ /**
100
+ * Watch contract events
101
+ *
102
+ * @example
103
+ * // Watch all Transfer events
104
+ * const unwatch = contract.watch.Transfer((event) => {
105
+ * console.log('Transfer:', event);
106
+ * });
107
+ *
108
+ * // Stop watching
109
+ * unwatch();
110
+ */
111
+ get watch(): {
112
+ /**
113
+ * Watch Received events
114
+ * @param callback Function to call when event is emitted
115
+ * @param filter Optional filter for indexed parameters
116
+ * @returns Unwatch function to stop listening
117
+ */
118
+ Received: (callback: (event: {
119
+ value: bigint;
120
+ sender: `0x${string}`;
121
+ data: `0x${string}`;
122
+ }) => void, filter?: {
123
+ value: bigint;
124
+ sender: `0x${string}`;
125
+ }) => () => void;
126
+ };
127
+ }
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Proxy_json = exports.Proxy_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * Proxy_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.Proxy_jsonAbi = [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "name": "_implementation",
15
+ "type": "address"
16
+ }
17
+ ],
18
+ "payable": false,
19
+ "stateMutability": "nonpayable",
20
+ "type": "constructor"
21
+ },
22
+ {
23
+ "payable": true,
24
+ "stateMutability": "payable",
25
+ "type": "fallback"
26
+ },
27
+ {
28
+ "anonymous": false,
29
+ "inputs": [
30
+ {
31
+ "indexed": true,
32
+ "name": "value",
33
+ "type": "uint256"
34
+ },
35
+ {
36
+ "indexed": true,
37
+ "name": "sender",
38
+ "type": "address"
39
+ },
40
+ {
41
+ "indexed": false,
42
+ "name": "data",
43
+ "type": "bytes"
44
+ }
45
+ ],
46
+ "name": "Received",
47
+ "type": "event"
48
+ }
49
+ ];
50
+ /**
51
+ * Proxy_json Contract Class
52
+ *
53
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * import { createPublicClient, createWalletClient, http } from 'viem';
58
+ * import { mainnet } from 'viem/chains';
59
+ * import { Proxy_json } from 'Proxy_json';
60
+ *
61
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
62
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
63
+ *
64
+ * const contract = new Proxy_json('0x...', { publicClient, walletClient });
65
+ *
66
+ * // Read functions
67
+ * const result = await contract.balanceOf('0x...');
68
+ *
69
+ * // Write functions
70
+ * const hash = await contract.transfer('0x...', 1000n);
71
+ *
72
+ * // Simulate transactions (dry-run)
73
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
74
+ * console.log('Gas estimate:', simulation.request.gas);
75
+ *
76
+ * // Watch events
77
+ * const unwatch = contract.watch.Transfer((event) => {
78
+ * console.log('Transfer event:', event);
79
+ * });
80
+ * ```
81
+ */
82
+ class Proxy_json {
83
+ constructor(address, clients) {
84
+ this.contractAddress = address;
85
+ this.publicClient = clients.publicClient;
86
+ this.contract = (0, viem_1.getContract)({
87
+ address,
88
+ abi: exports.Proxy_jsonAbi,
89
+ client: {
90
+ public: clients.publicClient,
91
+ wallet: clients.walletClient,
92
+ },
93
+ });
94
+ }
95
+ /**
96
+ * Get the contract address
97
+ */
98
+ get address() {
99
+ return this.contractAddress;
100
+ }
101
+ /**
102
+ * Get the underlying viem contract instance
103
+ */
104
+ getContract() {
105
+ return this.contract;
106
+ }
107
+ // No read functions
108
+ // No write functions
109
+ /**
110
+ * Simulate contract write operations (dry-run without sending transaction)
111
+ *
112
+ * Note: This contract has no write functions, so simulate returns an empty object.
113
+ */
114
+ get simulate() {
115
+ return {};
116
+ }
117
+ /**
118
+ * Watch contract events
119
+ *
120
+ * @example
121
+ * // Watch all Transfer events
122
+ * const unwatch = contract.watch.Transfer((event) => {
123
+ * console.log('Transfer:', event);
124
+ * });
125
+ *
126
+ * // Stop watching
127
+ * unwatch();
128
+ */
129
+ get watch() {
130
+ return {
131
+ /**
132
+ * Watch Received events
133
+ * @param callback Function to call when event is emitted
134
+ * @param filter Optional filter for indexed parameters
135
+ * @returns Unwatch function to stop listening
136
+ */
137
+ Received: (callback, filter) => {
138
+ return this.publicClient.watchContractEvent({
139
+ address: this.contractAddress,
140
+ abi: exports.Proxy_jsonAbi,
141
+ eventName: 'Received',
142
+ args: filter,
143
+ onLogs: (logs) => {
144
+ logs.forEach((log) => {
145
+ callback(log.args);
146
+ });
147
+ },
148
+ });
149
+ }
150
+ };
151
+ }
152
+ }
153
+ exports.Proxy_json = Proxy_json;
@@ -0,0 +1,182 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * Proxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const Proxy_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "name": "_implementation",
14
+ "type": "address"
15
+ }
16
+ ],
17
+ "payable": false,
18
+ "stateMutability": "nonpayable",
19
+ "type": "constructor"
20
+ },
21
+ {
22
+ "payable": true,
23
+ "stateMutability": "payable",
24
+ "type": "fallback"
25
+ },
26
+ {
27
+ "anonymous": false,
28
+ "inputs": [
29
+ {
30
+ "indexed": true,
31
+ "name": "value",
32
+ "type": "uint256"
33
+ },
34
+ {
35
+ "indexed": true,
36
+ "name": "sender",
37
+ "type": "address"
38
+ },
39
+ {
40
+ "indexed": false,
41
+ "name": "data",
42
+ "type": "bytes"
43
+ }
44
+ ],
45
+ "name": "Received",
46
+ "type": "event"
47
+ }
48
+ ] as const satisfies Abi;
49
+
50
+ /**
51
+ * Type-safe ABI for Proxy_json
52
+ */
53
+ export type Proxy_jsonAbi = typeof Proxy_jsonAbi;
54
+
55
+ /**
56
+ * Contract instance type for Proxy_json
57
+ */
58
+ // Use any for contract type to avoid complex viem type issues
59
+ // The runtime behavior is type-safe through viem's ABI typing
60
+ export type Proxy_jsonContract = any;
61
+
62
+ /**
63
+ * Proxy_json Contract Class
64
+ *
65
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * import { createPublicClient, createWalletClient, http } from 'viem';
70
+ * import { mainnet } from 'viem/chains';
71
+ * import { Proxy_json } from 'Proxy_json';
72
+ *
73
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
74
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
75
+ *
76
+ * const contract = new Proxy_json('0x...', { publicClient, walletClient });
77
+ *
78
+ * // Read functions
79
+ * const result = await contract.balanceOf('0x...');
80
+ *
81
+ * // Write functions
82
+ * const hash = await contract.transfer('0x...', 1000n);
83
+ *
84
+ * // Simulate transactions (dry-run)
85
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
86
+ * console.log('Gas estimate:', simulation.request.gas);
87
+ *
88
+ * // Watch events
89
+ * const unwatch = contract.watch.Transfer((event) => {
90
+ * console.log('Transfer event:', event);
91
+ * });
92
+ * ```
93
+ */
94
+ export class Proxy_json {
95
+ private contract: Proxy_jsonContract;
96
+ private contractAddress: Address;
97
+ private publicClient: PublicClient;
98
+
99
+ constructor(
100
+ address: Address,
101
+ clients: {
102
+ publicClient: PublicClient;
103
+ walletClient?: WalletClient;
104
+ }
105
+ ) {
106
+ this.contractAddress = address;
107
+ this.publicClient = clients.publicClient;
108
+ this.contract = getContract({
109
+ address,
110
+ abi: Proxy_jsonAbi,
111
+ client: {
112
+ public: clients.publicClient,
113
+ wallet: clients.walletClient,
114
+ },
115
+ });
116
+ }
117
+
118
+ /**
119
+ * Get the contract address
120
+ */
121
+ get address(): Address {
122
+ return this.contractAddress;
123
+ }
124
+
125
+ /**
126
+ * Get the underlying viem contract instance
127
+ */
128
+ getContract(): Proxy_jsonContract {
129
+ return this.contract;
130
+ }
131
+
132
+ // No read functions
133
+
134
+ // No write functions
135
+
136
+
137
+
138
+ /**
139
+ * Simulate contract write operations (dry-run without sending transaction)
140
+ *
141
+ * Note: This contract has no write functions, so simulate returns an empty object.
142
+ */
143
+ get simulate() {
144
+ return {};
145
+ }
146
+
147
+ /**
148
+ * Watch contract events
149
+ *
150
+ * @example
151
+ * // Watch all Transfer events
152
+ * const unwatch = contract.watch.Transfer((event) => {
153
+ * console.log('Transfer:', event);
154
+ * });
155
+ *
156
+ * // Stop watching
157
+ * unwatch();
158
+ */
159
+ get watch() {
160
+ return {
161
+ /**
162
+ * Watch Received events
163
+ * @param callback Function to call when event is emitted
164
+ * @param filter Optional filter for indexed parameters
165
+ * @returns Unwatch function to stop listening
166
+ */
167
+ Received: (callback: (event: { value: bigint; sender: `0x${string}`; data: `0x${string}` }) => void, filter?: { value: bigint; sender: `0x${string}` }) => {
168
+ return this.publicClient.watchContractEvent({
169
+ address: this.contractAddress,
170
+ abi: Proxy_jsonAbi,
171
+ eventName: 'Received',
172
+ args: filter,
173
+ onLogs: (logs: any[]) => {
174
+ logs.forEach((log: any) => {
175
+ callback(log.args as any);
176
+ });
177
+ },
178
+ }) as () => void;
179
+ }
180
+ };
181
+ }
182
+ }
@@ -0,0 +1,4 @@
1
+ export { Proxy_jsonAbi, Proxy_json } from './Proxy_json';
2
+ export type { Proxy_jsonAbi as Proxy_jsonAbiType, Proxy_jsonContract } from './Proxy_json';
3
+ export { BaseWallet_jsonAbi, BaseWallet_json } from './BaseWallet_json';
4
+ export type { BaseWallet_jsonAbi as BaseWallet_jsonAbiType, BaseWallet_jsonContract } from './BaseWallet_json';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseWallet_json = exports.BaseWallet_jsonAbi = exports.Proxy_json = exports.Proxy_jsonAbi = void 0;
4
+ // Auto-generated exports for all contracts
5
+ var Proxy_json_1 = require("./Proxy_json");
6
+ Object.defineProperty(exports, "Proxy_jsonAbi", { enumerable: true, get: function () { return Proxy_json_1.Proxy_jsonAbi; } });
7
+ Object.defineProperty(exports, "Proxy_json", { enumerable: true, get: function () { return Proxy_json_1.Proxy_json; } });
8
+ var BaseWallet_json_1 = require("./BaseWallet_json");
9
+ Object.defineProperty(exports, "BaseWallet_jsonAbi", { enumerable: true, get: function () { return BaseWallet_json_1.BaseWallet_jsonAbi; } });
10
+ Object.defineProperty(exports, "BaseWallet_json", { enumerable: true, get: function () { return BaseWallet_json_1.BaseWallet_json; } });
@@ -0,0 +1,5 @@
1
+ // Auto-generated exports for all contracts
2
+ export { Proxy_jsonAbi, Proxy_json } from './Proxy_json';
3
+ export type { Proxy_jsonAbi as Proxy_jsonAbiType, Proxy_jsonContract } from './Proxy_json';
4
+ export { BaseWallet_jsonAbi, BaseWallet_json } from './BaseWallet_json';
5
+ export type { BaseWallet_jsonAbi as BaseWallet_jsonAbiType, BaseWallet_jsonContract } from './BaseWallet_json';
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './contracts';
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // Auto-generated TypeScript type bindings
3
+ // This file exports all generated contract types
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./contracts"), exports);
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@gitmyabi/basewallet",
3
+ "version": "1.0.0",
4
+ "description": "Auto-generated TypeScript type bindings for BaseWallet (build etherscan-basewallet-3f396521-1786067444929, commit db5aee1, branch etherscan)",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.js",
10
+ "require": "./index.js",
11
+ "types": "./index.d.ts"
12
+ },
13
+ "./contracts": {
14
+ "import": "./contracts/index.js",
15
+ "require": "./contracts/index.js",
16
+ "types": "./contracts/index.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "contracts"
23
+ ],
24
+ "keywords": [
25
+ "ethereum",
26
+ "smart-contracts",
27
+ "viem",
28
+ "wagmi",
29
+ "typescript",
30
+ "abi",
31
+ "ethers-v6"
32
+ ],
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "viem": "^2.0.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/etherscan/basewallet"
40
+ },
41
+ "branch": "etherscan",
42
+ "shortHash": "db5aee1"
43
+ }