@gitmyabi/emo 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.
- package/README.md +108 -0
- package/contracts/EMO_json.d.ts +101 -0
- package/contracts/EMO_json.js +120 -0
- package/contracts/EMO_json.ts +149 -0
- package/contracts/ERC721CreatorImplementation_json.d.ts +2452 -0
- package/contracts/ERC721CreatorImplementation_json.js +2486 -0
- package/contracts/ERC721CreatorImplementation_json.ts +3225 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @gitmyabi/emo
|
|
2
|
+
|
|
3
|
+
Auto-generated TypeScript type bindings for **EMO**
|
|
4
|
+
|
|
5
|
+
- **Build ID**: `etherscan-emo-d3ce52c0-1784951349507`
|
|
6
|
+
- **Build Number**: 1
|
|
7
|
+
- **Commit**: `9aeafb0`
|
|
8
|
+
- **Branch**: `etherscan`
|
|
9
|
+
- **Target**: `ethers-v6`
|
|
10
|
+
- **Contracts**: 2
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @gitmyabi/emo@1.0.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Class-based API (TypeChain-like)
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { createPublicClient, createWalletClient, http } from 'viem';
|
|
24
|
+
import { mainnet } from 'viem/chains';
|
|
25
|
+
import { YourContract } from '@gitmyabi/emo';
|
|
26
|
+
|
|
27
|
+
const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
28
|
+
const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
29
|
+
|
|
30
|
+
// Create contract instance
|
|
31
|
+
const contract = new YourContract('0x...', { publicClient, walletClient });
|
|
32
|
+
|
|
33
|
+
// Read functions - call directly like TypeChain!
|
|
34
|
+
const result = await contract.yourMethod(param1, param2);
|
|
35
|
+
|
|
36
|
+
// Write functions - also call directly!
|
|
37
|
+
const hash = await contract.transfer('0x...', 1000n);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### With viem directly
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { createPublicClient, http } from 'viem';
|
|
44
|
+
import { mainnet } from 'viem/chains';
|
|
45
|
+
import { YourContractAbi } from '@gitmyabi/emo';
|
|
46
|
+
|
|
47
|
+
const client = createPublicClient({
|
|
48
|
+
chain: mainnet,
|
|
49
|
+
transport: http(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Fully typed contract read
|
|
53
|
+
const result = await client.readContract({
|
|
54
|
+
address: '0x...',
|
|
55
|
+
abi: YourContractAbi,
|
|
56
|
+
functionName: 'yourMethod',
|
|
57
|
+
args: [param1, param2],
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Fully typed contract write
|
|
61
|
+
const hash = await client.writeContract({
|
|
62
|
+
address: '0x...',
|
|
63
|
+
abi: YourContractAbi,
|
|
64
|
+
functionName: 'yourMethod',
|
|
65
|
+
args: [param1, param2],
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With wagmi
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { useReadContract, useWriteContract } from 'wagmi';
|
|
73
|
+
import { YourContractAbi } from '@gitmyabi/emo';
|
|
74
|
+
|
|
75
|
+
function MyComponent() {
|
|
76
|
+
const { data } = useReadContract({
|
|
77
|
+
address: '0x...',
|
|
78
|
+
abi: YourContractAbi,
|
|
79
|
+
functionName: 'yourMethod',
|
|
80
|
+
args: [param1, param2],
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const { writeContract } = useWriteContract();
|
|
84
|
+
|
|
85
|
+
const handleWrite = () => {
|
|
86
|
+
writeContract({
|
|
87
|
+
address: '0x...',
|
|
88
|
+
abi: YourContractAbi,
|
|
89
|
+
functionName: 'yourMethod',
|
|
90
|
+
args: [param1, param2],
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return <button onClick={handleWrite}>Call Contract</button>;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Type Safety
|
|
99
|
+
|
|
100
|
+
This package provides full TypeScript type safety for all contract methods, events, and parameters using viem's type system. All ABIs are exported as `const` assertions for maximum type inference.
|
|
101
|
+
|
|
102
|
+
## Generated Contracts
|
|
103
|
+
|
|
104
|
+
This package includes type bindings for 2 contract(s) generated from ABI artifacts.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
MIT
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* EMO_json ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EMO_jsonAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [];
|
|
9
|
+
readonly stateMutability: "nonpayable";
|
|
10
|
+
readonly type: "constructor";
|
|
11
|
+
}, {
|
|
12
|
+
readonly stateMutability: "payable";
|
|
13
|
+
readonly type: "fallback";
|
|
14
|
+
}, {
|
|
15
|
+
readonly inputs: readonly [];
|
|
16
|
+
readonly name: "implementation";
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly internalType: "address";
|
|
19
|
+
readonly name: "";
|
|
20
|
+
readonly type: "address";
|
|
21
|
+
}];
|
|
22
|
+
readonly stateMutability: "view";
|
|
23
|
+
readonly type: "function";
|
|
24
|
+
}, {
|
|
25
|
+
readonly stateMutability: "payable";
|
|
26
|
+
readonly type: "receive";
|
|
27
|
+
}];
|
|
28
|
+
/**
|
|
29
|
+
* Type-safe ABI for EMO_json
|
|
30
|
+
*/
|
|
31
|
+
export type EMO_jsonAbi = typeof EMO_jsonAbi;
|
|
32
|
+
/**
|
|
33
|
+
* Contract instance type for EMO_json
|
|
34
|
+
*/
|
|
35
|
+
export type EMO_jsonContract = any;
|
|
36
|
+
/**
|
|
37
|
+
* EMO_json Contract Class
|
|
38
|
+
*
|
|
39
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
44
|
+
* import { mainnet } from 'viem/chains';
|
|
45
|
+
* import { EMO_json } from 'EMO_json';
|
|
46
|
+
*
|
|
47
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
48
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
49
|
+
*
|
|
50
|
+
* const contract = new EMO_json('0x...', { publicClient, walletClient });
|
|
51
|
+
*
|
|
52
|
+
* // Read functions
|
|
53
|
+
* const result = await contract.balanceOf('0x...');
|
|
54
|
+
*
|
|
55
|
+
* // Write functions
|
|
56
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
57
|
+
*
|
|
58
|
+
* // Simulate transactions (dry-run)
|
|
59
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
60
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
61
|
+
*
|
|
62
|
+
* // Watch events
|
|
63
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
64
|
+
* console.log('Transfer event:', event);
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare class EMO_json {
|
|
69
|
+
private contract;
|
|
70
|
+
private contractAddress;
|
|
71
|
+
private publicClient;
|
|
72
|
+
constructor(address: Address, clients: {
|
|
73
|
+
publicClient: PublicClient;
|
|
74
|
+
walletClient?: WalletClient;
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Get the contract address
|
|
78
|
+
*/
|
|
79
|
+
get address(): Address;
|
|
80
|
+
/**
|
|
81
|
+
* Get the underlying viem contract instance
|
|
82
|
+
*/
|
|
83
|
+
getContract(): EMO_jsonContract;
|
|
84
|
+
/**
|
|
85
|
+
* implementation
|
|
86
|
+
* view
|
|
87
|
+
*/
|
|
88
|
+
implementation(): Promise<`0x${string}`>;
|
|
89
|
+
/**
|
|
90
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
91
|
+
*
|
|
92
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
93
|
+
*/
|
|
94
|
+
get simulate(): {};
|
|
95
|
+
/**
|
|
96
|
+
* Watch contract events
|
|
97
|
+
*
|
|
98
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
99
|
+
*/
|
|
100
|
+
get watch(): {};
|
|
101
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMO_json = exports.EMO_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* EMO_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.EMO_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [],
|
|
13
|
+
"stateMutability": "nonpayable",
|
|
14
|
+
"type": "constructor"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"stateMutability": "payable",
|
|
18
|
+
"type": "fallback"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"inputs": [],
|
|
22
|
+
"name": "implementation",
|
|
23
|
+
"outputs": [
|
|
24
|
+
{
|
|
25
|
+
"internalType": "address",
|
|
26
|
+
"name": "",
|
|
27
|
+
"type": "address"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"stateMutability": "view",
|
|
31
|
+
"type": "function"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"stateMutability": "payable",
|
|
35
|
+
"type": "receive"
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* EMO_json Contract Class
|
|
40
|
+
*
|
|
41
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
46
|
+
* import { mainnet } from 'viem/chains';
|
|
47
|
+
* import { EMO_json } from 'EMO_json';
|
|
48
|
+
*
|
|
49
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
50
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
51
|
+
*
|
|
52
|
+
* const contract = new EMO_json('0x...', { publicClient, walletClient });
|
|
53
|
+
*
|
|
54
|
+
* // Read functions
|
|
55
|
+
* const result = await contract.balanceOf('0x...');
|
|
56
|
+
*
|
|
57
|
+
* // Write functions
|
|
58
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
59
|
+
*
|
|
60
|
+
* // Simulate transactions (dry-run)
|
|
61
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
62
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
63
|
+
*
|
|
64
|
+
* // Watch events
|
|
65
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
66
|
+
* console.log('Transfer event:', event);
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
class EMO_json {
|
|
71
|
+
constructor(address, clients) {
|
|
72
|
+
this.contractAddress = address;
|
|
73
|
+
this.publicClient = clients.publicClient;
|
|
74
|
+
this.contract = (0, viem_1.getContract)({
|
|
75
|
+
address,
|
|
76
|
+
abi: exports.EMO_jsonAbi,
|
|
77
|
+
client: {
|
|
78
|
+
public: clients.publicClient,
|
|
79
|
+
wallet: clients.walletClient,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get the contract address
|
|
85
|
+
*/
|
|
86
|
+
get address() {
|
|
87
|
+
return this.contractAddress;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the underlying viem contract instance
|
|
91
|
+
*/
|
|
92
|
+
getContract() {
|
|
93
|
+
return this.contract;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* implementation
|
|
97
|
+
* view
|
|
98
|
+
*/
|
|
99
|
+
async implementation() {
|
|
100
|
+
return this.contract.read.implementation();
|
|
101
|
+
}
|
|
102
|
+
// No write functions
|
|
103
|
+
/**
|
|
104
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
105
|
+
*
|
|
106
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
107
|
+
*/
|
|
108
|
+
get simulate() {
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Watch contract events
|
|
113
|
+
*
|
|
114
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
115
|
+
*/
|
|
116
|
+
get watch() {
|
|
117
|
+
return {};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.EMO_json = EMO_json;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* EMO_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const EMO_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
13
|
+
"type": "constructor"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"stateMutability": "payable",
|
|
17
|
+
"type": "fallback"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"inputs": [],
|
|
21
|
+
"name": "implementation",
|
|
22
|
+
"outputs": [
|
|
23
|
+
{
|
|
24
|
+
"internalType": "address",
|
|
25
|
+
"name": "",
|
|
26
|
+
"type": "address"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"stateMutability": "view",
|
|
30
|
+
"type": "function"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"stateMutability": "payable",
|
|
34
|
+
"type": "receive"
|
|
35
|
+
}
|
|
36
|
+
] as const satisfies Abi;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Type-safe ABI for EMO_json
|
|
40
|
+
*/
|
|
41
|
+
export type EMO_jsonAbi = typeof EMO_jsonAbi;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Contract instance type for EMO_json
|
|
45
|
+
*/
|
|
46
|
+
// Use any for contract type to avoid complex viem type issues
|
|
47
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
48
|
+
export type EMO_jsonContract = any;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* EMO_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 { EMO_json } from 'EMO_json';
|
|
60
|
+
*
|
|
61
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
62
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
63
|
+
*
|
|
64
|
+
* const contract = new EMO_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
|
+
export class EMO_json {
|
|
83
|
+
private contract: EMO_jsonContract;
|
|
84
|
+
private contractAddress: Address;
|
|
85
|
+
private publicClient: PublicClient;
|
|
86
|
+
|
|
87
|
+
constructor(
|
|
88
|
+
address: Address,
|
|
89
|
+
clients: {
|
|
90
|
+
publicClient: PublicClient;
|
|
91
|
+
walletClient?: WalletClient;
|
|
92
|
+
}
|
|
93
|
+
) {
|
|
94
|
+
this.contractAddress = address;
|
|
95
|
+
this.publicClient = clients.publicClient;
|
|
96
|
+
this.contract = getContract({
|
|
97
|
+
address,
|
|
98
|
+
abi: EMO_jsonAbi,
|
|
99
|
+
client: {
|
|
100
|
+
public: clients.publicClient,
|
|
101
|
+
wallet: clients.walletClient,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get the contract address
|
|
108
|
+
*/
|
|
109
|
+
get address(): Address {
|
|
110
|
+
return this.contractAddress;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get the underlying viem contract instance
|
|
115
|
+
*/
|
|
116
|
+
getContract(): EMO_jsonContract {
|
|
117
|
+
return this.contract;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* implementation
|
|
122
|
+
* view
|
|
123
|
+
*/
|
|
124
|
+
async implementation(): Promise<`0x${string}`> {
|
|
125
|
+
return this.contract.read.implementation() as Promise<`0x${string}`>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// No write functions
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
134
|
+
*
|
|
135
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
136
|
+
*/
|
|
137
|
+
get simulate() {
|
|
138
|
+
return {};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Watch contract events
|
|
143
|
+
*
|
|
144
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
145
|
+
*/
|
|
146
|
+
get watch() {
|
|
147
|
+
return {};
|
|
148
|
+
}
|
|
149
|
+
}
|