@gitmyabi/safel 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/SafeL2_json.d.ts +1706 -0
- package/contracts/SafeL2_json.js +1902 -0
- package/contracts/SafeL2_json.ts +2270 -0
- package/contracts/SafeProxy_json.d.ts +87 -0
- package/contracts/SafeProxy_json.js +103 -0
- package/contracts/SafeProxy_json.ts +132 -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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* SafeProxy_json ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SafeProxy_jsonAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "_singleton";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "nonpayable";
|
|
14
|
+
readonly type: "constructor";
|
|
15
|
+
}, {
|
|
16
|
+
readonly stateMutability: "payable";
|
|
17
|
+
readonly type: "fallback";
|
|
18
|
+
}];
|
|
19
|
+
/**
|
|
20
|
+
* Type-safe ABI for SafeProxy_json
|
|
21
|
+
*/
|
|
22
|
+
export type SafeProxy_jsonAbi = typeof SafeProxy_jsonAbi;
|
|
23
|
+
/**
|
|
24
|
+
* Contract instance type for SafeProxy_json
|
|
25
|
+
*/
|
|
26
|
+
export type SafeProxy_jsonContract = any;
|
|
27
|
+
/**
|
|
28
|
+
* SafeProxy_json Contract Class
|
|
29
|
+
*
|
|
30
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
35
|
+
* import { mainnet } from 'viem/chains';
|
|
36
|
+
* import { SafeProxy_json } from 'SafeProxy_json';
|
|
37
|
+
*
|
|
38
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
39
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
40
|
+
*
|
|
41
|
+
* const contract = new SafeProxy_json('0x...', { publicClient, walletClient });
|
|
42
|
+
*
|
|
43
|
+
* // Read functions
|
|
44
|
+
* const result = await contract.balanceOf('0x...');
|
|
45
|
+
*
|
|
46
|
+
* // Write functions
|
|
47
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
48
|
+
*
|
|
49
|
+
* // Simulate transactions (dry-run)
|
|
50
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
51
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
52
|
+
*
|
|
53
|
+
* // Watch events
|
|
54
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
55
|
+
* console.log('Transfer event:', event);
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare class SafeProxy_json {
|
|
60
|
+
private contract;
|
|
61
|
+
private contractAddress;
|
|
62
|
+
private publicClient;
|
|
63
|
+
constructor(address: Address, clients: {
|
|
64
|
+
publicClient: PublicClient;
|
|
65
|
+
walletClient?: WalletClient;
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Get the contract address
|
|
69
|
+
*/
|
|
70
|
+
get address(): Address;
|
|
71
|
+
/**
|
|
72
|
+
* Get the underlying viem contract instance
|
|
73
|
+
*/
|
|
74
|
+
getContract(): SafeProxy_jsonContract;
|
|
75
|
+
/**
|
|
76
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
77
|
+
*
|
|
78
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
79
|
+
*/
|
|
80
|
+
get simulate(): {};
|
|
81
|
+
/**
|
|
82
|
+
* Watch contract events
|
|
83
|
+
*
|
|
84
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
85
|
+
*/
|
|
86
|
+
get watch(): {};
|
|
87
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SafeProxy_json = exports.SafeProxy_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* SafeProxy_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.SafeProxy_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "_singleton",
|
|
16
|
+
"type": "address"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"stateMutability": "payable",
|
|
24
|
+
"type": "fallback"
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* SafeProxy_json Contract Class
|
|
29
|
+
*
|
|
30
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
35
|
+
* import { mainnet } from 'viem/chains';
|
|
36
|
+
* import { SafeProxy_json } from 'SafeProxy_json';
|
|
37
|
+
*
|
|
38
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
39
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
40
|
+
*
|
|
41
|
+
* const contract = new SafeProxy_json('0x...', { publicClient, walletClient });
|
|
42
|
+
*
|
|
43
|
+
* // Read functions
|
|
44
|
+
* const result = await contract.balanceOf('0x...');
|
|
45
|
+
*
|
|
46
|
+
* // Write functions
|
|
47
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
48
|
+
*
|
|
49
|
+
* // Simulate transactions (dry-run)
|
|
50
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
51
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
52
|
+
*
|
|
53
|
+
* // Watch events
|
|
54
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
55
|
+
* console.log('Transfer event:', event);
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
class SafeProxy_json {
|
|
60
|
+
constructor(address, clients) {
|
|
61
|
+
this.contractAddress = address;
|
|
62
|
+
this.publicClient = clients.publicClient;
|
|
63
|
+
this.contract = (0, viem_1.getContract)({
|
|
64
|
+
address,
|
|
65
|
+
abi: exports.SafeProxy_jsonAbi,
|
|
66
|
+
client: {
|
|
67
|
+
public: clients.publicClient,
|
|
68
|
+
wallet: clients.walletClient,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the contract address
|
|
74
|
+
*/
|
|
75
|
+
get address() {
|
|
76
|
+
return this.contractAddress;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get the underlying viem contract instance
|
|
80
|
+
*/
|
|
81
|
+
getContract() {
|
|
82
|
+
return this.contract;
|
|
83
|
+
}
|
|
84
|
+
// No read functions
|
|
85
|
+
// No write functions
|
|
86
|
+
/**
|
|
87
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
88
|
+
*
|
|
89
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
90
|
+
*/
|
|
91
|
+
get simulate() {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Watch contract events
|
|
96
|
+
*
|
|
97
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
98
|
+
*/
|
|
99
|
+
get watch() {
|
|
100
|
+
return {};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.SafeProxy_json = SafeProxy_json;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SafeProxy_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const SafeProxy_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "_singleton",
|
|
15
|
+
"type": "address"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"stateMutability": "nonpayable",
|
|
19
|
+
"type": "constructor"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"stateMutability": "payable",
|
|
23
|
+
"type": "fallback"
|
|
24
|
+
}
|
|
25
|
+
] as const satisfies Abi;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Type-safe ABI for SafeProxy_json
|
|
29
|
+
*/
|
|
30
|
+
export type SafeProxy_jsonAbi = typeof SafeProxy_jsonAbi;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Contract instance type for SafeProxy_json
|
|
34
|
+
*/
|
|
35
|
+
// Use any for contract type to avoid complex viem type issues
|
|
36
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
37
|
+
export type SafeProxy_jsonContract = any;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* SafeProxy_json Contract Class
|
|
41
|
+
*
|
|
42
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
47
|
+
* import { mainnet } from 'viem/chains';
|
|
48
|
+
* import { SafeProxy_json } from 'SafeProxy_json';
|
|
49
|
+
*
|
|
50
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
51
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
52
|
+
*
|
|
53
|
+
* const contract = new SafeProxy_json('0x...', { publicClient, walletClient });
|
|
54
|
+
*
|
|
55
|
+
* // Read functions
|
|
56
|
+
* const result = await contract.balanceOf('0x...');
|
|
57
|
+
*
|
|
58
|
+
* // Write functions
|
|
59
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
60
|
+
*
|
|
61
|
+
* // Simulate transactions (dry-run)
|
|
62
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
63
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
64
|
+
*
|
|
65
|
+
* // Watch events
|
|
66
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
67
|
+
* console.log('Transfer event:', event);
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export class SafeProxy_json {
|
|
72
|
+
private contract: SafeProxy_jsonContract;
|
|
73
|
+
private contractAddress: Address;
|
|
74
|
+
private publicClient: PublicClient;
|
|
75
|
+
|
|
76
|
+
constructor(
|
|
77
|
+
address: Address,
|
|
78
|
+
clients: {
|
|
79
|
+
publicClient: PublicClient;
|
|
80
|
+
walletClient?: WalletClient;
|
|
81
|
+
}
|
|
82
|
+
) {
|
|
83
|
+
this.contractAddress = address;
|
|
84
|
+
this.publicClient = clients.publicClient;
|
|
85
|
+
this.contract = getContract({
|
|
86
|
+
address,
|
|
87
|
+
abi: SafeProxy_jsonAbi,
|
|
88
|
+
client: {
|
|
89
|
+
public: clients.publicClient,
|
|
90
|
+
wallet: clients.walletClient,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get the contract address
|
|
97
|
+
*/
|
|
98
|
+
get address(): Address {
|
|
99
|
+
return this.contractAddress;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Get the underlying viem contract instance
|
|
104
|
+
*/
|
|
105
|
+
getContract(): SafeProxy_jsonContract {
|
|
106
|
+
return this.contract;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// No read functions
|
|
110
|
+
|
|
111
|
+
// No write functions
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
117
|
+
*
|
|
118
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
119
|
+
*/
|
|
120
|
+
get simulate() {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Watch contract events
|
|
126
|
+
*
|
|
127
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
128
|
+
*/
|
|
129
|
+
get watch() {
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SafeProxy_jsonAbi, SafeProxy_json } from './SafeProxy_json';
|
|
2
|
+
export type { SafeProxy_jsonAbi as SafeProxy_jsonAbiType, SafeProxy_jsonContract } from './SafeProxy_json';
|
|
3
|
+
export { SafeL2_jsonAbi, SafeL2_json } from './SafeL2_json';
|
|
4
|
+
export type { SafeL2_jsonAbi as SafeL2_jsonAbiType, SafeL2_jsonContract } from './SafeL2_json';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SafeL2_json = exports.SafeL2_jsonAbi = exports.SafeProxy_json = exports.SafeProxy_jsonAbi = void 0;
|
|
4
|
+
// Auto-generated exports for all contracts
|
|
5
|
+
var SafeProxy_json_1 = require("./SafeProxy_json");
|
|
6
|
+
Object.defineProperty(exports, "SafeProxy_jsonAbi", { enumerable: true, get: function () { return SafeProxy_json_1.SafeProxy_jsonAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "SafeProxy_json", { enumerable: true, get: function () { return SafeProxy_json_1.SafeProxy_json; } });
|
|
8
|
+
var SafeL2_json_1 = require("./SafeL2_json");
|
|
9
|
+
Object.defineProperty(exports, "SafeL2_jsonAbi", { enumerable: true, get: function () { return SafeL2_json_1.SafeL2_jsonAbi; } });
|
|
10
|
+
Object.defineProperty(exports, "SafeL2_json", { enumerable: true, get: function () { return SafeL2_json_1.SafeL2_json; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Auto-generated exports for all contracts
|
|
2
|
+
export { SafeProxy_jsonAbi, SafeProxy_json } from './SafeProxy_json';
|
|
3
|
+
export type { SafeProxy_jsonAbi as SafeProxy_jsonAbiType, SafeProxy_jsonContract } from './SafeProxy_json';
|
|
4
|
+
export { SafeL2_jsonAbi, SafeL2_json } from './SafeL2_json';
|
|
5
|
+
export type { SafeL2_jsonAbi as SafeL2_jsonAbiType, SafeL2_jsonContract } from './SafeL2_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/safel",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for SafeL (build etherscan-safel-a82bcc5b-1786103653101, commit 3650e79, 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/safel"
|
|
40
|
+
},
|
|
41
|
+
"branch": "etherscan",
|
|
42
|
+
"shortHash": "3650e79"
|
|
43
|
+
}
|