@openzeppelin/contracts-mcp 0.5.6 → 0.5.8
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/cairo/tools/account.js +2 -2
- package/dist/cairo/tools/account.js.map +1 -1
- package/dist/cairo/tools/custom.js +2 -2
- package/dist/cairo/tools/custom.js.map +1 -1
- package/dist/cairo/tools/erc1155.js +2 -2
- package/dist/cairo/tools/erc1155.js.map +1 -1
- package/dist/cairo/tools/erc20.js +2 -2
- package/dist/cairo/tools/erc20.js.map +1 -1
- package/dist/cairo/tools/erc721.js +2 -2
- package/dist/cairo/tools/erc721.js.map +1 -1
- package/dist/cairo/tools/governor.js +2 -2
- package/dist/cairo/tools/governor.js.map +1 -1
- package/dist/cairo/tools/multisig.js +2 -2
- package/dist/cairo/tools/multisig.js.map +1 -1
- package/dist/cairo/tools/vesting.js +2 -2
- package/dist/cairo/tools/vesting.js.map +1 -1
- package/dist/confidential/tools/erc7984.js +2 -2
- package/dist/confidential/tools/erc7984.js.map +1 -1
- package/dist/solidity/tools/account.js +2 -2
- package/dist/solidity/tools/account.js.map +1 -1
- package/dist/solidity/tools/custom.js +2 -2
- package/dist/solidity/tools/custom.js.map +1 -1
- package/dist/solidity/tools/erc1155.js +2 -2
- package/dist/solidity/tools/erc1155.js.map +1 -1
- package/dist/solidity/tools/erc20.js +2 -2
- package/dist/solidity/tools/erc20.js.map +1 -1
- package/dist/solidity/tools/erc721.js +2 -2
- package/dist/solidity/tools/erc721.js.map +1 -1
- package/dist/solidity/tools/governor.js +2 -2
- package/dist/solidity/tools/governor.js.map +1 -1
- package/dist/solidity/tools/rwa.js +2 -2
- package/dist/solidity/tools/rwa.js.map +1 -1
- package/dist/solidity/tools/stablecoin.js +2 -2
- package/dist/solidity/tools/stablecoin.js.map +1 -1
- package/dist/stellar/tools/fungible.d.ts.map +1 -1
- package/dist/stellar/tools/fungible.js +3 -2
- package/dist/stellar/tools/fungible.js.map +1 -1
- package/dist/stellar/tools/governor.d.ts +3 -0
- package/dist/stellar/tools/governor.d.ts.map +1 -0
- package/dist/stellar/tools/governor.js +33 -0
- package/dist/stellar/tools/governor.js.map +1 -0
- package/dist/stellar/tools/non-fungible.d.ts.map +1 -1
- package/dist/stellar/tools/non-fungible.js +3 -2
- package/dist/stellar/tools/non-fungible.js.map +1 -1
- package/dist/stellar/tools/stablecoin.d.ts.map +1 -1
- package/dist/stellar/tools/stablecoin.js +3 -2
- package/dist/stellar/tools/stablecoin.js.map +1 -1
- package/dist/stellar/tools.d.ts.map +1 -1
- package/dist/stellar/tools.js +2 -0
- package/dist/stellar/tools.js.map +1 -1
- package/dist/stylus/tools/erc1155.js +2 -2
- package/dist/stylus/tools/erc1155.js.map +1 -1
- package/dist/stylus/tools/erc20.js +2 -2
- package/dist/stylus/tools/erc20.js.map +1 -1
- package/dist/stylus/tools/erc721.js +2 -2
- package/dist/stylus/tools/erc721.js.map +1 -1
- package/dist/uniswap-hooks/tools/hooks.js +2 -2
- package/dist/uniswap-hooks/tools/hooks.js.map +1 -1
- package/package.json +6 -6
- package/src/cairo/tools/account.ts +2 -2
- package/src/cairo/tools/custom.ts +2 -2
- package/src/cairo/tools/erc1155.ts +2 -2
- package/src/cairo/tools/erc20.ts +2 -2
- package/src/cairo/tools/erc721.ts +2 -2
- package/src/cairo/tools/governor.ts +2 -2
- package/src/cairo/tools/multisig.ts +2 -2
- package/src/cairo/tools/vesting.ts +2 -2
- package/src/confidential/tools/erc7984.ts +2 -2
- package/src/solidity/tools/account.ts +2 -2
- package/src/solidity/tools/custom.ts +2 -2
- package/src/solidity/tools/erc1155.ts +2 -2
- package/src/solidity/tools/erc20.ts +2 -2
- package/src/solidity/tools/erc721.ts +2 -2
- package/src/solidity/tools/governor.ts +2 -2
- package/src/solidity/tools/rwa.ts +2 -2
- package/src/solidity/tools/stablecoin.ts +2 -2
- package/src/stellar/tools/fungible.ts +4 -2
- package/src/stellar/tools/governor.ts +49 -0
- package/src/stellar/tools/non-fungible.ts +4 -2
- package/src/stellar/tools/stablecoin.ts +4 -2
- package/src/stellar/tools.ts +2 -0
- package/src/stylus/tools/erc1155.ts +2 -2
- package/src/stylus/tools/erc20.ts +2 -2
- package/src/stylus/tools/erc721.ts +2 -2
- package/src/uniswap-hooks/tools/hooks.ts +2 -2
- package/dist/cairo/schemas.d.ts +0 -200
- package/dist/cairo/schemas.d.ts.map +0 -1
- package/dist/cairo/schemas.js +0 -153
- package/dist/cairo/schemas.js.map +0 -1
- package/dist/confidential/schemas.d.ts +0 -21
- package/dist/confidential/schemas.d.ts.map +0 -1
- package/dist/confidential/schemas.js +0 -33
- package/dist/confidential/schemas.js.map +0 -1
- package/dist/solidity/schemas.d.ts +0 -157
- package/dist/solidity/schemas.d.ts.map +0 -1
- package/dist/solidity/schemas.js +0 -166
- package/dist/solidity/schemas.js.map +0 -1
- package/dist/stellar/schemas.d.ts +0 -60
- package/dist/stellar/schemas.d.ts.map +0 -1
- package/dist/stellar/schemas.js +0 -58
- package/dist/stellar/schemas.js.map +0 -1
- package/dist/stylus/schemas.d.ts +0 -36
- package/dist/stylus/schemas.d.ts.map +0 -1
- package/dist/stylus/schemas.js +0 -44
- package/dist/stylus/schemas.js.map +0 -1
- package/dist/uniswap-hooks/schemas.d.ts +0 -67
- package/dist/uniswap-hooks/schemas.d.ts.map +0 -1
- package/dist/uniswap-hooks/schemas.js +0 -78
- package/dist/uniswap-hooks/schemas.js.map +0 -1
- package/src/cairo/schemas.ts +0 -176
- package/src/confidential/schemas.ts +0 -35
- package/src/solidity/schemas.ts +0 -186
- package/src/stellar/schemas.ts +0 -69
- package/src/stylus/schemas.ts +0 -54
- package/src/uniswap-hooks/schemas.ts +0 -92
package/src/cairo/schemas.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
commonDescriptions,
|
|
4
|
-
infoDescriptions,
|
|
5
|
-
cairoCommonDescriptions,
|
|
6
|
-
cairoAccessDescriptions,
|
|
7
|
-
cairoMacrosDescriptions,
|
|
8
|
-
cairoERC20Descriptions,
|
|
9
|
-
cairoERC721Descriptions,
|
|
10
|
-
cairoRoyaltyInfoDescriptions,
|
|
11
|
-
cairoERC1155Descriptions,
|
|
12
|
-
cairoAccountDescriptions,
|
|
13
|
-
cairoGovernorDescriptions,
|
|
14
|
-
cairoMultisigDescriptions,
|
|
15
|
-
cairoVestingDescriptions,
|
|
16
|
-
} from '@openzeppelin/wizard-common';
|
|
17
|
-
import type { KindedOptions } from '@openzeppelin/wizard-cairo';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Static type assertions to ensure schemas satisfy the Wizard API types. Not called at runtime.
|
|
21
|
-
*/
|
|
22
|
-
function _typeAssertions() {
|
|
23
|
-
const _assertions: {
|
|
24
|
-
[K in keyof KindedOptions]: Omit<KindedOptions[K], 'kind'>;
|
|
25
|
-
} = {
|
|
26
|
-
ERC20: z.object(erc20Schema).parse({}),
|
|
27
|
-
ERC721: z.object(erc721Schema).parse({}),
|
|
28
|
-
ERC1155: z.object(erc1155Schema).parse({}),
|
|
29
|
-
Account: z.object(accountSchema).parse({}),
|
|
30
|
-
Multisig: z.object(multisigSchema).parse({}),
|
|
31
|
-
Governor: z.object(governorSchema).parse({}),
|
|
32
|
-
Vesting: z.object(vestingSchema).parse({}),
|
|
33
|
-
Custom: z.object(customSchema).parse({}),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const commonSchema = {
|
|
38
|
-
access: z.object({
|
|
39
|
-
type: z
|
|
40
|
-
.literal('ownable')
|
|
41
|
-
.or(z.literal('roles'))
|
|
42
|
-
.or(z.literal('roles-dar'))
|
|
43
|
-
.or(z.literal(false))
|
|
44
|
-
.describe(cairoAccessDescriptions.accessType),
|
|
45
|
-
darInitialDelay: z.string().describe(cairoAccessDescriptions.darInitialDelay),
|
|
46
|
-
darDefaultDelayIncrease: z.string().describe(cairoAccessDescriptions.darDefaultDelayIncrease),
|
|
47
|
-
darMaxTransferDelay: z.string().describe(cairoAccessDescriptions.darMaxTransferDelay),
|
|
48
|
-
}),
|
|
49
|
-
upgradeable: z.boolean().optional().describe(cairoCommonDescriptions.upgradeable),
|
|
50
|
-
info: z
|
|
51
|
-
.object({
|
|
52
|
-
securityContact: z.string().optional().describe(infoDescriptions.securityContact),
|
|
53
|
-
license: z.string().optional().describe(infoDescriptions.license),
|
|
54
|
-
})
|
|
55
|
-
.optional()
|
|
56
|
-
.describe(infoDescriptions.info),
|
|
57
|
-
macros: z
|
|
58
|
-
.object({
|
|
59
|
-
withComponents: z.boolean().describe(cairoMacrosDescriptions.withComponents),
|
|
60
|
-
})
|
|
61
|
-
.optional()
|
|
62
|
-
.describe(cairoMacrosDescriptions.macros),
|
|
63
|
-
} as const satisfies z.ZodRawShape;
|
|
64
|
-
|
|
65
|
-
export const erc20Schema = {
|
|
66
|
-
name: z.string().describe(commonDescriptions.name),
|
|
67
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
68
|
-
decimals: z.string().optional().describe(cairoERC20Descriptions.decimals),
|
|
69
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
70
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
71
|
-
premint: z.string().optional().describe(cairoERC20Descriptions.premint),
|
|
72
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
73
|
-
votes: z.boolean().optional().describe(cairoERC20Descriptions.votes),
|
|
74
|
-
appName: z.string().optional().describe(cairoCommonDescriptions.appName),
|
|
75
|
-
appVersion: z.string().optional().describe(cairoCommonDescriptions.appVersion),
|
|
76
|
-
...commonSchema,
|
|
77
|
-
} as const satisfies z.ZodRawShape;
|
|
78
|
-
|
|
79
|
-
export const erc721Schema = {
|
|
80
|
-
name: z.string().describe(commonDescriptions.name),
|
|
81
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
82
|
-
baseUri: z.string().optional().describe(cairoERC721Descriptions.baseUri),
|
|
83
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
84
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
85
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
86
|
-
enumerable: z.boolean().optional().describe(cairoERC721Descriptions.enumerable),
|
|
87
|
-
votes: z.boolean().optional().describe(cairoERC721Descriptions.votes),
|
|
88
|
-
royaltyInfo: z
|
|
89
|
-
.object({
|
|
90
|
-
enabled: z.boolean().describe(cairoRoyaltyInfoDescriptions.enabled),
|
|
91
|
-
defaultRoyaltyFraction: z.string().describe(cairoRoyaltyInfoDescriptions.defaultRoyaltyFraction),
|
|
92
|
-
feeDenominator: z.string().describe(cairoRoyaltyInfoDescriptions.feeDenominator),
|
|
93
|
-
})
|
|
94
|
-
.optional()
|
|
95
|
-
.describe(cairoCommonDescriptions.royaltyInfo),
|
|
96
|
-
appName: z.string().optional().describe(cairoCommonDescriptions.appName),
|
|
97
|
-
appVersion: z.string().optional().describe(cairoCommonDescriptions.appVersion),
|
|
98
|
-
...commonSchema,
|
|
99
|
-
} as const satisfies z.ZodRawShape;
|
|
100
|
-
|
|
101
|
-
export const erc1155Schema = {
|
|
102
|
-
name: z.string().describe(commonDescriptions.name),
|
|
103
|
-
baseUri: z.string().describe(cairoERC1155Descriptions.baseUri),
|
|
104
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
105
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
106
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
107
|
-
updatableUri: z.boolean().optional().describe(cairoERC1155Descriptions.updatableUri),
|
|
108
|
-
royaltyInfo: z
|
|
109
|
-
.object({
|
|
110
|
-
enabled: z.boolean().describe(cairoRoyaltyInfoDescriptions.enabled),
|
|
111
|
-
defaultRoyaltyFraction: z.string().describe(cairoRoyaltyInfoDescriptions.defaultRoyaltyFraction),
|
|
112
|
-
feeDenominator: z.string().describe(cairoRoyaltyInfoDescriptions.feeDenominator),
|
|
113
|
-
})
|
|
114
|
-
.optional()
|
|
115
|
-
.describe(cairoCommonDescriptions.royaltyInfo),
|
|
116
|
-
...commonSchema,
|
|
117
|
-
} as const satisfies z.ZodRawShape;
|
|
118
|
-
|
|
119
|
-
export const accountSchema = {
|
|
120
|
-
name: z.string().describe(commonDescriptions.name),
|
|
121
|
-
type: z.enum(['stark', 'eth']).describe(cairoAccountDescriptions.type),
|
|
122
|
-
declare: z.boolean().optional().describe(cairoAccountDescriptions.declare),
|
|
123
|
-
deploy: z.boolean().optional().describe(cairoAccountDescriptions.deploy),
|
|
124
|
-
pubkey: z.boolean().optional().describe(cairoAccountDescriptions.pubkey),
|
|
125
|
-
outsideExecution: z.boolean().optional().describe(cairoAccountDescriptions.outsideExecution),
|
|
126
|
-
upgradeable: commonSchema.upgradeable,
|
|
127
|
-
info: commonSchema.info,
|
|
128
|
-
macros: commonSchema.macros,
|
|
129
|
-
} as const satisfies z.ZodRawShape;
|
|
130
|
-
|
|
131
|
-
export const multisigSchema = {
|
|
132
|
-
name: z.string().describe(commonDescriptions.name),
|
|
133
|
-
quorum: z.string().describe(cairoMultisigDescriptions.quorum),
|
|
134
|
-
upgradeable: commonSchema.upgradeable,
|
|
135
|
-
info: commonSchema.info,
|
|
136
|
-
macros: commonSchema.macros,
|
|
137
|
-
} as const satisfies z.ZodRawShape;
|
|
138
|
-
|
|
139
|
-
export const governorSchema = {
|
|
140
|
-
name: z.string().describe(commonDescriptions.name),
|
|
141
|
-
delay: z.string().describe(cairoGovernorDescriptions.delay),
|
|
142
|
-
period: z.string().describe(cairoGovernorDescriptions.period),
|
|
143
|
-
votes: z.enum(['erc20votes', 'erc721votes']).optional().describe(cairoGovernorDescriptions.votes),
|
|
144
|
-
clockMode: z.enum(['timestamp']).optional().describe(cairoGovernorDescriptions.clockMode),
|
|
145
|
-
timelock: z
|
|
146
|
-
.union([z.literal(false), z.literal('openzeppelin')])
|
|
147
|
-
.optional()
|
|
148
|
-
.describe(cairoGovernorDescriptions.timelock),
|
|
149
|
-
decimals: z.number().optional().describe(cairoGovernorDescriptions.decimals),
|
|
150
|
-
proposalThreshold: z.string().optional().describe(cairoGovernorDescriptions.proposalThreshold),
|
|
151
|
-
quorumMode: z.enum(['percent', 'absolute']).optional().describe(cairoGovernorDescriptions.quorumMode),
|
|
152
|
-
quorumPercent: z.number().optional().describe(cairoGovernorDescriptions.quorumPercent),
|
|
153
|
-
quorumAbsolute: z.string().optional().describe(cairoGovernorDescriptions.quorumAbsolute),
|
|
154
|
-
settings: z.boolean().optional().describe(cairoGovernorDescriptions.settings),
|
|
155
|
-
upgradeable: commonSchema.upgradeable,
|
|
156
|
-
appName: z.string().optional().describe(cairoCommonDescriptions.appName),
|
|
157
|
-
appVersion: z.string().optional().describe(cairoCommonDescriptions.appVersion),
|
|
158
|
-
info: commonSchema.info,
|
|
159
|
-
macros: commonSchema.macros,
|
|
160
|
-
} as const satisfies z.ZodRawShape;
|
|
161
|
-
|
|
162
|
-
export const vestingSchema = {
|
|
163
|
-
name: z.string().describe(commonDescriptions.name),
|
|
164
|
-
startDate: z.string().describe(cairoVestingDescriptions.startDate),
|
|
165
|
-
duration: z.string().describe(cairoVestingDescriptions.duration),
|
|
166
|
-
cliffDuration: z.string().describe(cairoVestingDescriptions.cliffDuration),
|
|
167
|
-
schedule: z.enum(['linear', 'custom']).describe(cairoVestingDescriptions.schedule),
|
|
168
|
-
info: commonSchema.info,
|
|
169
|
-
macros: commonSchema.macros,
|
|
170
|
-
} as const satisfies z.ZodRawShape;
|
|
171
|
-
|
|
172
|
-
export const customSchema = {
|
|
173
|
-
name: z.string().describe(commonDescriptions.name),
|
|
174
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
175
|
-
...commonSchema,
|
|
176
|
-
} as const satisfies z.ZodRawShape;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { commonDescriptions, infoDescriptions, confidentialERC7984Descriptions } from '@openzeppelin/wizard-common';
|
|
3
|
-
import type { KindedOptions } from '@openzeppelin/wizard-confidential';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Static type assertions to ensure schemas satisfy the Wizard API types. Not called at runtime.
|
|
7
|
-
*/
|
|
8
|
-
function _typeAssertions() {
|
|
9
|
-
const _assertions: {
|
|
10
|
-
[K in keyof KindedOptions]: Omit<KindedOptions[K], 'kind'>;
|
|
11
|
-
} = {
|
|
12
|
-
ERC7984: z.object(erc7984Schema).parse({}),
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const commonSchema = {
|
|
17
|
-
info: z
|
|
18
|
-
.object({
|
|
19
|
-
securityContact: z.string().optional().describe(infoDescriptions.securityContact),
|
|
20
|
-
license: z.string().optional().describe(infoDescriptions.license),
|
|
21
|
-
})
|
|
22
|
-
.optional()
|
|
23
|
-
.describe(infoDescriptions.info),
|
|
24
|
-
} as const satisfies z.ZodRawShape;
|
|
25
|
-
|
|
26
|
-
export const erc7984Schema = {
|
|
27
|
-
name: z.string().describe(commonDescriptions.name),
|
|
28
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
29
|
-
contractURI: z.string().describe(confidentialERC7984Descriptions.contractURI),
|
|
30
|
-
premint: z.string().optional().describe(confidentialERC7984Descriptions.premint),
|
|
31
|
-
networkConfig: z.literal('zama-ethereum').describe(confidentialERC7984Descriptions.networkConfig),
|
|
32
|
-
wrappable: z.boolean().optional().describe(confidentialERC7984Descriptions.wrappable),
|
|
33
|
-
votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(confidentialERC7984Descriptions.votes),
|
|
34
|
-
...commonSchema,
|
|
35
|
-
} as const satisfies z.ZodRawShape;
|
package/src/solidity/schemas.ts
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
commonDescriptions,
|
|
4
|
-
infoDescriptions,
|
|
5
|
-
solidityCommonDescriptions,
|
|
6
|
-
solidityERC20Descriptions,
|
|
7
|
-
solidityERC721Descriptions,
|
|
8
|
-
solidityERC1155Descriptions,
|
|
9
|
-
solidityGovernorDescriptions,
|
|
10
|
-
solidityAccountDescriptions,
|
|
11
|
-
solidityStablecoinDescriptions,
|
|
12
|
-
} from '@openzeppelin/wizard-common';
|
|
13
|
-
import type { KindedOptions } from '@openzeppelin/wizard';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Static type assertions to ensure schemas satisfy the Wizard API types. Not called at runtime.
|
|
17
|
-
*/
|
|
18
|
-
function _typeAssertions() {
|
|
19
|
-
const _assertions: {
|
|
20
|
-
[K in keyof KindedOptions]: Omit<KindedOptions[K], 'kind'>;
|
|
21
|
-
} = {
|
|
22
|
-
ERC20: z.object(erc20Schema).parse({}),
|
|
23
|
-
ERC721: z.object(erc721Schema).parse({}),
|
|
24
|
-
ERC1155: z.object(erc1155Schema).parse({}),
|
|
25
|
-
Stablecoin: z.object(stablecoinSchema).parse({}),
|
|
26
|
-
RealWorldAsset: z.object(rwaSchema).parse({}),
|
|
27
|
-
Account: z.object(accountSchema).parse({}),
|
|
28
|
-
Governor: z.object(governorSchema).parse({}),
|
|
29
|
-
Custom: z.object(customSchema).parse({}),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const commonSchema = {
|
|
34
|
-
access: z
|
|
35
|
-
.literal('ownable')
|
|
36
|
-
.or(z.literal('roles'))
|
|
37
|
-
.or(z.literal('managed'))
|
|
38
|
-
.optional()
|
|
39
|
-
.describe(solidityCommonDescriptions.access),
|
|
40
|
-
upgradeable: z
|
|
41
|
-
.literal('transparent')
|
|
42
|
-
.or(z.literal('uups'))
|
|
43
|
-
.optional()
|
|
44
|
-
.describe(solidityCommonDescriptions.upgradeable),
|
|
45
|
-
info: z
|
|
46
|
-
.object({
|
|
47
|
-
securityContact: z.string().optional().describe(infoDescriptions.securityContact),
|
|
48
|
-
license: z.string().optional().describe(infoDescriptions.license),
|
|
49
|
-
})
|
|
50
|
-
.optional()
|
|
51
|
-
.describe(infoDescriptions.info),
|
|
52
|
-
} as const satisfies z.ZodRawShape;
|
|
53
|
-
|
|
54
|
-
export const erc20Schema = {
|
|
55
|
-
name: z.string().describe(commonDescriptions.name),
|
|
56
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
57
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
58
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
59
|
-
premint: z.string().optional().describe(solidityERC20Descriptions.premint),
|
|
60
|
-
premintChainId: z.string().optional().describe(solidityERC20Descriptions.premintChainId),
|
|
61
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
62
|
-
callback: z.boolean().optional().describe(solidityERC20Descriptions.callback),
|
|
63
|
-
permit: z.boolean().optional().describe(solidityERC20Descriptions.permit),
|
|
64
|
-
votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC20Descriptions.votes),
|
|
65
|
-
flashmint: z.boolean().optional().describe(solidityERC20Descriptions.flashmint),
|
|
66
|
-
crossChainBridging: z
|
|
67
|
-
.literal('custom')
|
|
68
|
-
.or(z.literal('erc7786native'))
|
|
69
|
-
.or(z.literal('superchain'))
|
|
70
|
-
.optional()
|
|
71
|
-
.describe(solidityERC20Descriptions.crossChainBridging),
|
|
72
|
-
crossChainLinkAllowOverride: z.boolean().optional().describe(solidityERC20Descriptions.crossChainLinkAllowOverride),
|
|
73
|
-
namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix),
|
|
74
|
-
...commonSchema,
|
|
75
|
-
} as const satisfies z.ZodRawShape;
|
|
76
|
-
|
|
77
|
-
export const erc721Schema = {
|
|
78
|
-
name: z.string().describe(commonDescriptions.name),
|
|
79
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
80
|
-
baseUri: z.string().optional().describe(solidityERC721Descriptions.baseUri),
|
|
81
|
-
enumerable: z.boolean().optional().describe(solidityERC721Descriptions.enumerable),
|
|
82
|
-
uriStorage: z.boolean().optional().describe(solidityERC721Descriptions.uriStorage),
|
|
83
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
84
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
85
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
86
|
-
incremental: z.boolean().optional().describe(solidityERC721Descriptions.incremental),
|
|
87
|
-
votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC721Descriptions.votes),
|
|
88
|
-
...commonSchema,
|
|
89
|
-
namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix),
|
|
90
|
-
} as const satisfies z.ZodRawShape;
|
|
91
|
-
|
|
92
|
-
export const erc1155Schema = {
|
|
93
|
-
name: z.string().describe(commonDescriptions.name),
|
|
94
|
-
uri: z.string().describe(solidityERC1155Descriptions.uri),
|
|
95
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
96
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
97
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
98
|
-
supply: z.boolean().optional().describe(solidityERC1155Descriptions.supply),
|
|
99
|
-
updatableUri: z.boolean().optional().describe(solidityERC1155Descriptions.updatableUri),
|
|
100
|
-
...commonSchema,
|
|
101
|
-
} as const satisfies z.ZodRawShape;
|
|
102
|
-
|
|
103
|
-
const { upgradeable: _, ...erc20SchemaOmitUpgradeable } = erc20Schema;
|
|
104
|
-
|
|
105
|
-
export const stablecoinSchema = {
|
|
106
|
-
...erc20SchemaOmitUpgradeable,
|
|
107
|
-
restrictions: z
|
|
108
|
-
.literal(false)
|
|
109
|
-
.or(z.literal('allowlist'))
|
|
110
|
-
.or(z.literal('blocklist'))
|
|
111
|
-
.optional()
|
|
112
|
-
.describe(solidityStablecoinDescriptions.restrictions),
|
|
113
|
-
freezable: z.boolean().optional().describe(solidityStablecoinDescriptions.freezable),
|
|
114
|
-
} as const satisfies z.ZodRawShape;
|
|
115
|
-
|
|
116
|
-
export const rwaSchema = stablecoinSchema;
|
|
117
|
-
|
|
118
|
-
export const accountSchema = {
|
|
119
|
-
name: z.string().describe('The name of the account contract'),
|
|
120
|
-
signatureValidation: z
|
|
121
|
-
.literal(false)
|
|
122
|
-
.or(z.literal('ERC1271'))
|
|
123
|
-
.or(z.literal('ERC7739'))
|
|
124
|
-
.optional()
|
|
125
|
-
.describe(solidityAccountDescriptions.signatureValidation),
|
|
126
|
-
ERC721Holder: z.boolean().optional().describe(solidityAccountDescriptions.ERC721Holder),
|
|
127
|
-
ERC1155Holder: z.boolean().optional().describe(solidityAccountDescriptions.ERC1155Holder),
|
|
128
|
-
signer: z
|
|
129
|
-
.literal(false)
|
|
130
|
-
.or(z.literal('ECDSA'))
|
|
131
|
-
.or(z.literal('EIP7702'))
|
|
132
|
-
.or(z.literal('Multisig'))
|
|
133
|
-
.or(z.literal('MultisigWeighted'))
|
|
134
|
-
.or(z.literal('P256'))
|
|
135
|
-
.or(z.literal('RSA'))
|
|
136
|
-
.or(z.literal('WebAuthn'))
|
|
137
|
-
.optional()
|
|
138
|
-
.describe(solidityAccountDescriptions.signer),
|
|
139
|
-
batchedExecution: z.boolean().optional().describe(solidityAccountDescriptions.batchedExecution),
|
|
140
|
-
ERC7579Modules: z
|
|
141
|
-
.literal(false)
|
|
142
|
-
.or(z.literal('AccountERC7579'))
|
|
143
|
-
.or(z.literal('AccountERC7579Hooked'))
|
|
144
|
-
.optional()
|
|
145
|
-
.describe(solidityAccountDescriptions.ERC7579Modules),
|
|
146
|
-
info: commonSchema.info,
|
|
147
|
-
upgradeable: commonSchema.upgradeable,
|
|
148
|
-
} as const satisfies z.ZodRawShape;
|
|
149
|
-
|
|
150
|
-
export const governorSchema = {
|
|
151
|
-
name: z.string().describe(commonDescriptions.name),
|
|
152
|
-
delay: z.string().describe(solidityGovernorDescriptions.delay),
|
|
153
|
-
period: z.string().describe(solidityGovernorDescriptions.period),
|
|
154
|
-
votes: z.literal('erc20votes').or(z.literal('erc721votes')).optional().describe(solidityGovernorDescriptions.votes),
|
|
155
|
-
clockMode: z
|
|
156
|
-
.literal('blocknumber')
|
|
157
|
-
.or(z.literal('timestamp'))
|
|
158
|
-
.optional()
|
|
159
|
-
.describe(solidityGovernorDescriptions.clockMode),
|
|
160
|
-
timelock: z
|
|
161
|
-
.literal(false)
|
|
162
|
-
.or(z.literal('openzeppelin'))
|
|
163
|
-
.or(z.literal('compound'))
|
|
164
|
-
.optional()
|
|
165
|
-
.describe(solidityGovernorDescriptions.timelock),
|
|
166
|
-
blockTime: z.number().optional().describe(solidityGovernorDescriptions.blockTime),
|
|
167
|
-
decimals: z.number().optional().describe(solidityGovernorDescriptions.decimals),
|
|
168
|
-
proposalThreshold: z.string().optional().describe(solidityGovernorDescriptions.proposalThreshold),
|
|
169
|
-
quorumMode: z
|
|
170
|
-
.literal('percent')
|
|
171
|
-
.or(z.literal('absolute'))
|
|
172
|
-
.optional()
|
|
173
|
-
.describe(solidityGovernorDescriptions.quorumMode),
|
|
174
|
-
quorumPercent: z.number().optional().describe(solidityGovernorDescriptions.quorumPercent),
|
|
175
|
-
quorumAbsolute: z.string().optional().describe(solidityGovernorDescriptions.quorumAbsolute),
|
|
176
|
-
storage: z.boolean().optional().describe(solidityGovernorDescriptions.storage),
|
|
177
|
-
settings: z.boolean().optional().describe(solidityGovernorDescriptions.settings),
|
|
178
|
-
upgradeable: commonSchema.upgradeable,
|
|
179
|
-
info: commonSchema.info,
|
|
180
|
-
} as const satisfies z.ZodRawShape;
|
|
181
|
-
|
|
182
|
-
export const customSchema = {
|
|
183
|
-
name: z.string().describe(commonDescriptions.name),
|
|
184
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
185
|
-
...commonSchema,
|
|
186
|
-
} as const satisfies z.ZodRawShape;
|
package/src/stellar/schemas.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
commonDescriptions,
|
|
4
|
-
infoDescriptions,
|
|
5
|
-
stellarCommonDescriptions,
|
|
6
|
-
stellarFungibleDescriptions,
|
|
7
|
-
stellarNonFungibleDescriptions,
|
|
8
|
-
stellarStablecoinDescriptions,
|
|
9
|
-
} from '@openzeppelin/wizard-common';
|
|
10
|
-
import type { KindedOptions } from '@openzeppelin/wizard-stellar';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Static type assertions to ensure schemas satisfy the Wizard API types. Not called at runtime.
|
|
14
|
-
*/
|
|
15
|
-
function _typeAssertions() {
|
|
16
|
-
const _assertions: {
|
|
17
|
-
[K in keyof KindedOptions]: Omit<KindedOptions[K], 'kind'>;
|
|
18
|
-
} = {
|
|
19
|
-
Fungible: z.object(fungibleSchema).parse({}),
|
|
20
|
-
Stablecoin: z.object(stablecoinSchema).parse({}),
|
|
21
|
-
NonFungible: z.object(nonFungibleSchema).parse({}),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const commonSchema = {
|
|
26
|
-
access: z.literal('ownable').or(z.literal('roles')).optional().describe(stellarCommonDescriptions.access),
|
|
27
|
-
explicitImplementations: z.boolean().optional().describe(stellarCommonDescriptions.explicitImplementations),
|
|
28
|
-
upgradeable: z.boolean().optional().describe(stellarCommonDescriptions.upgradeable),
|
|
29
|
-
info: z
|
|
30
|
-
.object({
|
|
31
|
-
securityContact: z.string().optional().describe(infoDescriptions.securityContact),
|
|
32
|
-
license: z.string().optional().describe(infoDescriptions.license),
|
|
33
|
-
})
|
|
34
|
-
.optional()
|
|
35
|
-
.describe(infoDescriptions.info),
|
|
36
|
-
} as const satisfies z.ZodRawShape;
|
|
37
|
-
|
|
38
|
-
export const fungibleSchema = {
|
|
39
|
-
name: z.string().describe(commonDescriptions.name),
|
|
40
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
41
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
42
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
43
|
-
premint: z.string().optional().describe(stellarFungibleDescriptions.premint),
|
|
44
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
45
|
-
...commonSchema,
|
|
46
|
-
} as const satisfies z.ZodRawShape;
|
|
47
|
-
|
|
48
|
-
export const stablecoinSchema = {
|
|
49
|
-
...fungibleSchema,
|
|
50
|
-
limitations: z
|
|
51
|
-
.literal(false)
|
|
52
|
-
.or(z.literal('allowlist'))
|
|
53
|
-
.or(z.literal('blocklist'))
|
|
54
|
-
.optional()
|
|
55
|
-
.describe(stellarStablecoinDescriptions.limitations),
|
|
56
|
-
} as const satisfies z.ZodRawShape;
|
|
57
|
-
|
|
58
|
-
export const nonFungibleSchema = {
|
|
59
|
-
name: z.string().describe(commonDescriptions.name),
|
|
60
|
-
symbol: z.string().describe(commonDescriptions.symbol),
|
|
61
|
-
tokenUri: z.string().optional().describe(stellarNonFungibleDescriptions.tokenUri),
|
|
62
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
63
|
-
enumerable: z.boolean().optional().describe(stellarNonFungibleDescriptions.enumerable),
|
|
64
|
-
consecutive: z.boolean().optional().describe(stellarNonFungibleDescriptions.consecutive),
|
|
65
|
-
pausable: z.boolean().optional().describe(commonDescriptions.pausable),
|
|
66
|
-
mintable: z.boolean().optional().describe(commonDescriptions.mintable),
|
|
67
|
-
sequential: z.boolean().optional().describe(stellarNonFungibleDescriptions.sequential),
|
|
68
|
-
...commonSchema,
|
|
69
|
-
} as const satisfies z.ZodRawShape;
|
package/src/stylus/schemas.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
commonDescriptions,
|
|
4
|
-
infoDescriptions,
|
|
5
|
-
stylusERC20Descriptions,
|
|
6
|
-
stylusERC721Descriptions,
|
|
7
|
-
stylusERC1155Descriptions,
|
|
8
|
-
} from '@openzeppelin/wizard-common';
|
|
9
|
-
import type { KindedOptions } from '@openzeppelin/wizard-stylus';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Static type assertions to ensure schemas satisfy the Wizard API types. Not called at runtime.
|
|
13
|
-
*/
|
|
14
|
-
function _typeAssertions() {
|
|
15
|
-
const _assertions: {
|
|
16
|
-
[K in keyof KindedOptions]: Omit<KindedOptions[K], 'kind'>;
|
|
17
|
-
} = {
|
|
18
|
-
ERC20: z.object(erc20Schema).parse({}),
|
|
19
|
-
ERC721: z.object(erc721Schema).parse({}),
|
|
20
|
-
ERC1155: z.object(erc1155Schema).parse({}),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const commonSchema = {
|
|
25
|
-
info: z
|
|
26
|
-
.object({
|
|
27
|
-
securityContact: z.string().optional().describe(infoDescriptions.securityContact),
|
|
28
|
-
license: z.string().optional().describe(infoDescriptions.license),
|
|
29
|
-
})
|
|
30
|
-
.optional()
|
|
31
|
-
.describe(infoDescriptions.info),
|
|
32
|
-
} as const satisfies z.ZodRawShape;
|
|
33
|
-
|
|
34
|
-
export const erc20Schema = {
|
|
35
|
-
name: z.string().describe(commonDescriptions.name),
|
|
36
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
37
|
-
permit: z.boolean().optional().describe(stylusERC20Descriptions.permit),
|
|
38
|
-
flashmint: z.boolean().optional().describe(stylusERC20Descriptions.flashmint),
|
|
39
|
-
...commonSchema,
|
|
40
|
-
} as const satisfies z.ZodRawShape;
|
|
41
|
-
|
|
42
|
-
export const erc721Schema = {
|
|
43
|
-
name: z.string().describe(commonDescriptions.name),
|
|
44
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
45
|
-
enumerable: z.boolean().optional().describe(stylusERC721Descriptions.enumerable),
|
|
46
|
-
...commonSchema,
|
|
47
|
-
} as const satisfies z.ZodRawShape;
|
|
48
|
-
|
|
49
|
-
export const erc1155Schema = {
|
|
50
|
-
name: z.string().describe(commonDescriptions.name),
|
|
51
|
-
burnable: z.boolean().optional().describe(commonDescriptions.burnable),
|
|
52
|
-
supply: z.boolean().optional().describe(stylusERC1155Descriptions.supply),
|
|
53
|
-
...commonSchema,
|
|
54
|
-
} as const satisfies z.ZodRawShape;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
commonDescriptions,
|
|
4
|
-
infoDescriptions,
|
|
5
|
-
uniswapHooksDescriptions,
|
|
6
|
-
uniswapHooksSharesDescriptions,
|
|
7
|
-
uniswapHooksPermissionDescriptions,
|
|
8
|
-
uniswapHooksInputsDescriptions,
|
|
9
|
-
solidityCommonDescriptions,
|
|
10
|
-
} from '@openzeppelin/wizard-common';
|
|
11
|
-
import { HooksNames, ShareOptions, type KindedOptions } from '@openzeppelin/wizard-uniswap-hooks';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Static type assertions to ensure schemas satisfy the Wizard API types. Not called at runtime.
|
|
15
|
-
*/
|
|
16
|
-
function _typeAssertions() {
|
|
17
|
-
const _assertions: {
|
|
18
|
-
[K in keyof KindedOptions]: Omit<KindedOptions[K], 'kind'>;
|
|
19
|
-
} = {
|
|
20
|
-
Hooks: z.object(hooksSchema).parse({}),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const hookEnum = z.enum(HooksNames);
|
|
25
|
-
|
|
26
|
-
const sharesOptionsSchema = z.union([z.literal(false), z.enum(ShareOptions)]);
|
|
27
|
-
|
|
28
|
-
export const commonSchema = {
|
|
29
|
-
access: z
|
|
30
|
-
.literal('ownable')
|
|
31
|
-
.or(z.literal('roles'))
|
|
32
|
-
.or(z.literal('managed'))
|
|
33
|
-
.optional()
|
|
34
|
-
.describe(solidityCommonDescriptions.access),
|
|
35
|
-
info: z
|
|
36
|
-
.object({
|
|
37
|
-
securityContact: z.string().optional().describe(infoDescriptions.securityContact),
|
|
38
|
-
license: z.string().optional().describe(infoDescriptions.license),
|
|
39
|
-
})
|
|
40
|
-
.optional()
|
|
41
|
-
.describe(infoDescriptions.info),
|
|
42
|
-
} as const satisfies z.ZodRawShape;
|
|
43
|
-
|
|
44
|
-
const sharesSchema = z
|
|
45
|
-
.object({
|
|
46
|
-
options: sharesOptionsSchema.describe(uniswapHooksSharesDescriptions.options),
|
|
47
|
-
name: z.string().optional().describe(uniswapHooksSharesDescriptions.name),
|
|
48
|
-
symbol: z.string().optional().describe(uniswapHooksSharesDescriptions.symbol),
|
|
49
|
-
uri: z.string().optional().describe(uniswapHooksSharesDescriptions.uri),
|
|
50
|
-
})
|
|
51
|
-
.describe(uniswapHooksDescriptions.shares);
|
|
52
|
-
|
|
53
|
-
const permissionsSchema = z
|
|
54
|
-
.object({
|
|
55
|
-
beforeInitialize: z.boolean().describe(uniswapHooksPermissionDescriptions.beforeInitialize),
|
|
56
|
-
afterInitialize: z.boolean().describe(uniswapHooksPermissionDescriptions.afterInitialize),
|
|
57
|
-
beforeAddLiquidity: z.boolean().describe(uniswapHooksPermissionDescriptions.beforeAddLiquidity),
|
|
58
|
-
beforeRemoveLiquidity: z.boolean().describe(uniswapHooksPermissionDescriptions.beforeRemoveLiquidity),
|
|
59
|
-
afterAddLiquidity: z.boolean().describe(uniswapHooksPermissionDescriptions.afterAddLiquidity),
|
|
60
|
-
afterRemoveLiquidity: z.boolean().describe(uniswapHooksPermissionDescriptions.afterRemoveLiquidity),
|
|
61
|
-
beforeSwap: z.boolean().describe(uniswapHooksPermissionDescriptions.beforeSwap),
|
|
62
|
-
afterSwap: z.boolean().describe(uniswapHooksPermissionDescriptions.afterSwap),
|
|
63
|
-
beforeDonate: z.boolean().describe(uniswapHooksPermissionDescriptions.beforeDonate),
|
|
64
|
-
afterDonate: z.boolean().describe(uniswapHooksPermissionDescriptions.afterDonate),
|
|
65
|
-
beforeSwapReturnDelta: z.boolean().describe(uniswapHooksPermissionDescriptions.beforeSwapReturnDelta),
|
|
66
|
-
afterSwapReturnDelta: z.boolean().describe(uniswapHooksPermissionDescriptions.afterSwapReturnDelta),
|
|
67
|
-
afterAddLiquidityReturnDelta: z.boolean().describe(uniswapHooksPermissionDescriptions.afterAddLiquidityReturnDelta),
|
|
68
|
-
afterRemoveLiquidityReturnDelta: z
|
|
69
|
-
.boolean()
|
|
70
|
-
.describe(uniswapHooksPermissionDescriptions.afterRemoveLiquidityReturnDelta),
|
|
71
|
-
})
|
|
72
|
-
.describe(uniswapHooksDescriptions.permissions);
|
|
73
|
-
|
|
74
|
-
const inputsSchema = z
|
|
75
|
-
.object({
|
|
76
|
-
blockNumberOffset: z.number().describe(uniswapHooksInputsDescriptions.blockNumberOffset),
|
|
77
|
-
maxAbsTickDelta: z.number().describe(uniswapHooksInputsDescriptions.maxAbsTickDelta),
|
|
78
|
-
})
|
|
79
|
-
.describe(uniswapHooksDescriptions.inputs);
|
|
80
|
-
|
|
81
|
-
export const hooksSchema = {
|
|
82
|
-
hook: hookEnum.describe(uniswapHooksDescriptions.hook),
|
|
83
|
-
name: z.string().describe(commonDescriptions.name),
|
|
84
|
-
pausable: z.boolean().describe(commonDescriptions.pausable),
|
|
85
|
-
currencySettler: z.boolean().describe(uniswapHooksDescriptions.currencySettler),
|
|
86
|
-
safeCast: z.boolean().describe(uniswapHooksDescriptions.safeCast),
|
|
87
|
-
transientStorage: z.boolean().describe(uniswapHooksDescriptions.transientStorage),
|
|
88
|
-
shares: sharesSchema,
|
|
89
|
-
permissions: permissionsSchema,
|
|
90
|
-
inputs: inputsSchema,
|
|
91
|
-
...commonSchema,
|
|
92
|
-
} as const satisfies z.ZodRawShape;
|