Documentation Index
Fetch the complete documentation index at: https://docs.oumla.com/llms.txt
Use this file to discover all available pages before exploring further.
Manage smart contract templates and deploy contracts from templates.
Methods
getContracts()
Get a paginated list of contract templates.
Signature:
getContracts(
request?: GetContractsRequest,
requestOptions?: RequestOptions
): Promise<ContractTemplatesResponse>
Example:
const templates = await client.contractTemplates.getContracts({
skip: 0,
take: 25
});
console.log('Templates:', templates.data);
getContractById()
Get details for a specific contract template.
Signature:
getContractById(
templateId: string,
requestOptions?: RequestOptions
): Promise<ContractTemplateResponse>
Example:
const template = await client.contractTemplates.getContractById('template-id');
console.log('Template:', template.data.result);
console.log('Name:', template.data.result?.name);
console.log('Type:', template.data.result?.type);
getContractConstructorById()
Get constructor information for a template.
Signature:
getContractConstructorById(
templateId: string,
requestOptions?: RequestOptions
): Promise<ConstructorInfoResponse>
Example:
const constructorInfo = await client.contractTemplates.getContractConstructorById('template-id');
console.log('Constructor inputs:', constructorInfo.data.contractConstructor?.inputs);
getContractFunctionById()
Get function information for a template.
Signature:
getContractFunctionById(
templateId: string,
requestOptions?: RequestOptions
): Promise<FunctionInfoResponse>
Example:
const functions = await client.contractTemplates.getContractFunctionById('template-id');
console.log('Available functions:', functions.data.contractFunction);
deployContract()
Deploy a contract from a template. Returns a workflow ID for async processing.
Signature:
deployContract(
templateId: string,
request: DeployContractRequest,
requestOptions?: RequestOptions
): Promise<DeployContractResponse>
Parameters:
| Parameter | Type | Required | Description |
|---|
templateId | string | Yes | Template ID |
request.networkId | string | Yes | Network ID (from getNetworks()) |
request.addressId | string | Yes | Address ID for deployment |
request.clientShare | string | Yes | Client share for signing |
request.constructorParameters | array | No | Array of constructor parameter objects [{ name, type, value }, ...] |
Example Request:
const deployment = await client.contractTemplates.deployContract('template-id', {
networkId: 'your-network-id',
addressId: 'address-id',
clientShare: 'your-client-share',
constructorParameters: [
{ name: 'name', type: 'string', value: 'MyToken' },
{ name: 'symbol', type: 'string', value: 'MTK' },
{ name: 'initialSupply', type: 'uint256', value: '1000000' }
]
});
Example Response:
{
data: {
workflowResult: {
workflowId: 'workflow-id-here',
operationId: 'deployment-id-here',
status: 'started',
message: 'Deploy contract workflow started'
}
}
}
Response Fields:
| Field | Type | Required | Description |
|---|
data.workflowResult.workflowId | string | Yes | Workflow ID for tracking contract deployment |
data.workflowResult.operationId | string | Yes | Operation ID (e.g. deploymentId) |
data.workflowResult.status | 'started' | 'already_running' | Yes | Workflow status |
data.workflowResult.message | string | Yes | Human-readable status message |
console.log('Deployment Workflow ID:', deployment.data.workflowResult.workflowId);
createContract()
Create a new contract template.
Signature:
createContract(
request: CreateContractRequest,
requestOptions?: RequestOptions
): Promise<ContractTemplateResponse>
deleteContract()
Delete a contract template.
Signature:
deleteContract(
templateId: string,
requestOptions?: RequestOptions
): Promise<void>