|
| 1 | +import type { AiFunctionDefinition } from '../types/function-definition.ts'; |
| 2 | +import { addFunctionPropertiesFrom } from './shared.ts'; |
| 3 | +import { stylusCommonFunctionDescription } from './stylus-shared.ts'; |
| 4 | + |
| 5 | +export const stylusERC20AIFunctionDefinition = { |
| 6 | + name: 'ERC20', |
| 7 | + description: 'Make a fungible token per the ERC-20 standard', |
| 8 | + parameters: { |
| 9 | + type: 'object', |
| 10 | + properties: { |
| 11 | + ...addFunctionPropertiesFrom(stylusCommonFunctionDescription, ['name', 'burnable', 'access', 'info']), |
| 12 | + permit: { |
| 13 | + type: 'boolean', |
| 14 | + description: |
| 15 | + 'Whether without paying gas, token holders will be able to allow third parties to transfer from their account.', |
| 16 | + }, |
| 17 | + flashmint: { |
| 18 | + type: 'boolean', |
| 19 | + description: |
| 20 | + "Whether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction.", |
| 21 | + }, |
| 22 | + }, |
| 23 | + required: ['name'], |
| 24 | + additionalProperties: false, |
| 25 | + }, |
| 26 | +} as const satisfies AiFunctionDefinition<'stylus', 'ERC20'>; |
| 27 | + |
| 28 | +export const stylusERC721AIFunctionDefinition = { |
| 29 | + name: 'ERC721', |
| 30 | + description: 'Make a non-fungible token per the ERC-721 standard', |
| 31 | + parameters: { |
| 32 | + type: 'object', |
| 33 | + properties: { |
| 34 | + ...addFunctionPropertiesFrom(stylusCommonFunctionDescription, ['name', 'burnable', 'access', 'info']), |
| 35 | + enumerable: { |
| 36 | + type: 'boolean', |
| 37 | + description: |
| 38 | + 'Whether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers.', |
| 39 | + }, |
| 40 | + }, |
| 41 | + required: ['name'], |
| 42 | + additionalProperties: false, |
| 43 | + }, |
| 44 | +} as const satisfies AiFunctionDefinition<'stylus', 'ERC721'>; |
| 45 | + |
| 46 | +export const stylusERC1155AIFunctionDefinition = { |
| 47 | + name: 'ERC1155', |
| 48 | + description: 'Make a non-fungible token per the ERC-1155 standard', |
| 49 | + parameters: { |
| 50 | + type: 'object', |
| 51 | + properties: { |
| 52 | + ...addFunctionPropertiesFrom(stylusCommonFunctionDescription, ['name', 'burnable', 'access', 'info']), |
| 53 | + supply: { |
| 54 | + type: 'boolean', |
| 55 | + description: 'Whether to keep track of total supply of tokens', |
| 56 | + }, |
| 57 | + }, |
| 58 | + required: ['name'], |
| 59 | + additionalProperties: false, |
| 60 | + }, |
| 61 | +} as const satisfies AiFunctionDefinition<'stylus', 'ERC1155'>; |
0 commit comments