package @zkoracle/opennautilus-contracts
Classes
Name | Summary |
---|---|
A basic request client contract that implements the |
|
Defines the basic interface for a token contract. All token contracts should inherit from this class and implement its methods. |
|
Represents a standard interface for fungible tokens, implementing the ERC20 standard. |
|
Defines the interface for an ERC677 token contract. Extends the standard ERC20 interface with the additional {IERC20} |
|
Abstract class representing an Oracle client. |
|
An Oracle contract implementing the |
|
from message oracle.OracleRequest |
|
Functions
buildBasicTokenContract(address, symbol)
Creates a basic token contract instance.
This function handles the following steps: 1. Compiles the BasicTokenContract
class. 2. Initializes the contract with the provided symbol. 3. Sets up necessary permissions for the contract. 4. Returns the newly created contract instance.
Name | Type | Description |
---|---|---|
|
|
The address where the contract will be deployed |
|
|
The symbol for the token (e.g., "MYTOKEN") |
Returns |
|
A promise that resolves to the created token contract instance |
export declare function buildBasicTokenContract(address: PublicKey, symbol: string): Promise<TokenContract & IBasicTokenContract>;
buildERC20Contract(address, name, symbol, decimals)
Constructs and deploys an ERC20 token contract.
This function creates a new contract class that implements the IERC20
interface, compiles it, and deploys it to the blockchain. The returned contract instance can be used to interact with the token’s functionality.
Name | Type | Description |
---|---|---|
|
|
The address of the token contract on the blockchain. |
|
|
The name of the token. |
|
|
The symbol of the token. |
|
|
The number of decimals used to represent token amounts. |
Returns |
|
A promise that resolves to the deployed contract instance. |
export declare function buildERC20Contract(address: PublicKey, name: string, symbol: string, decimals: number): Promise<TokenContract & IERC20>;
buildERC677Contract(address, name, symbol, decimals)
Builds and returns an instance of an ERC677 token contract.
Name | Type | Description |
---|---|---|
|
|
The contract address. |
|
|
The token name. |
|
|
The token symbol. |
|
|
The number of decimals for token precision. |
Returns |
|
{Promise<SmartContract & IERC677>} - A promise that resolves to the constructed contract instance. |
export declare function buildERC677Contract(address: PublicKey, name: string, symbol: string, decimals: number): Promise<TokenContract & IERC677>;
buildOracleRequestTx(sender, zkApp, oracleRequest)
Builds a Mina transaction that sends an Oracle request to a designated zkApp.
Name | Type | Description |
---|---|---|
|
|
The fee payer specification for the transaction. |
|
|
The zkApp contract that accepts Oracle requests, also implementing the |
|
The data for the Oracle request, represented as an |
|
Returns |
|
{Promise<Mina.Transaction>} A promise that resolves to a Mina transaction containing the Oracle request. |
export declare function buildOracleRequestTx(sender: Mina.FeePayerSpec, zkApp: SmartContract & IOracleClient, oracleRequest: OracleRequest): Promise<Mina.Transaction<false, false>>;
buildTransferAndCallTx(sender, pk, zkApp, oracleRequest)
Builds a transfer and call transaction.
Name | Type | Description |
---|---|---|
|
|
The sender of the transaction. |
|
|
|
|
|
The smart contract that implements the OracleClient interface. |
|
The oracle request to be sent. {Promise<Mina.Transaction>} A promise that resolves to the built transaction. |
|
Returns |
|
export declare function buildTransferAndCallTx(sender: Mina.FeePayerSpec, pk: PublicKey, zkApp: SmartContract & IOracleClient, oracleRequest: OracleRequest): Promise<Mina.Transaction<false, false>>;