@nilfoundation/niljs
Classes
Class | Description |
---|---|
BaseClient | BaseClient is the base class for any client tasked with interacting with =nil; BaseClient |
BaseError | The base class for custom errors. |
BlockNotFoundError | The error class for 'block not found' errors. This error is thrown when the requested block is not found. |
CometaService | CometaService is a client that interacts with the Cometa service. Cometa service is used to store contract metadata: source code, ABI, etc. CometaService |
ExternalTransactionEnvelope | The envelope for an external transaction (a transaction sent by a user, a dApp, etc.) |
FaucetClient | FaucetClient is a client that interacts with the faucet api. It is used to get information about the faucet and to top up the account with custom tokens. FaucetClient |
HttpTransport | HttpTransport represents the HTTP transport for connecting to the network. |
IntegerOutOfRangeError | The error class for 'integer out of range' errors. This error is thrown when the requested integer is out of range. |
InternalTransactionEnvelope | The envelope for an internal transaction (a transaction sent by a smart contract to another smart contract). |
InvalidShardIdError | The error class for invalid shard ID. This error is thrown when the provided shard ID is invalid. |
ITransport | The transport interface. |
LocalECDSAKeySigner | The LocalKeySigner is a class that allows for signing data with the private key. It uses the secp256k1 curve implementation by the @noble/curves/secp256k1 library. |
PublicClient | PublicClient is a class that allows for interacting with the network via the JSON-RPC API. It provides an abstraction of the connection to =nil;. PublicClient enables using API requests that do not require signing data (or otherwise using one's private key). |
SmartAccountV1 | SmartAccountV1 is a class used for performing operations on the cluster that require authentication. |
Interfaces
Interface | Description |
---|---|
ISigner | The interface for the Signer class |
ITransaction | The interface for the transaction object. This object is used to represent a transaction in the client code. It may differ from the actual transaction object used inside the network. |
SmartAccountInterface | - |
Type Aliases
Type alias | Description |
---|---|
AbiCallArgs | The args for peforming a call with the specified ABI and function name. |
AbiEventParametersToPrimitiveTypes | - |
AbiEventParameterToPrimitiveType | - |
AbiEventTopicToPrimitiveType | - |
AbiItem | - |
AbiItemArgs | - |
AbiItemName | - |
ArrayToObject | - |
BaseCallArgs | The args for performing a call to a smart contract. |
Block | The block type. Type T determines whether the block contains processed transactions or just transaction hashes. |
BlockTag | The block tag type. |
CallArgs | The args for performing either a call with embedded data or a call with a specific ABI and function name. |
CallParams | Represents the transaction call params. |
CallRes | The structure representing the results of a call. |
CometaServiceConfig | The type representing the config for the Cometa service client. |
CommonReadContractMethods | - |
CommonWriteContractMethods | - |
ContractConstructorArgs | - |
ContractData | Contract data. |
ContractErrorArgs | - |
ContractErrorName | - |
ContractEventArgs | - |
ContractEventArgsFromTopics | - |
ContractEventName | - |
ContractFunctionArgs | - |
ContractFunctionName | - |
ContractFunctionParameters | - |
ContractFunctionReturnType | - |
ContractOverride | The structure for overriding certain contract params. |
DataCallArgs | The args for performing a call with some embedded data. |
DeployParams | Represents the params for deploying a smart contract. |
EstimateFeeResult | - |
EventDefinition | - |
ExternalContractsMethod | - |
ExternalTransaction | The external transaction type. |
ExtractAbiFunctionForArgs | - |
ExtractAbiItem | - |
ExtractAbiItemForArgs | - |
ExtractAbiItemNames | - |
FaucetClientConfig | The type representing the config for the faucet client. |
Filter | Filters out all members of T that are not P |
GetContractParams | - |
GetEventArgs | - |
GetValue | - |
Hex | The hex type. |
IAddress | IAddress type represents an address in hexadecimal format. |
IBaseErrorParameters | The interface for the parameters of the BaseError constructor. |
IClientBaseConfig | The client configuration that is shared between public and private clients. |
IDeployContractOptions | The options for deploying a contract. |
IDeployData | - |
IHttpTransportConfig | The interface representing the configuration of the HTTP transport. |
ILocalKeySignerConfig | The interface for the configuration object of LocalKeySigner. |
ILog | The log interface. |
IPrivateKey | IPrivateKey represents a private key in hexadecimal format. |
IPublicClientConfig | The type representing the config for the public client. |
ISendTransactionOptions | The options for sending a transaction. |
ISignTransactionOptions | The options for signing a transaction. |
ISmartAccountClientConfig | The type representing the config for the basic smart account. |
IsNarrowable | - |
IsUnion | - |
Location | Location. |
LogTopic | - |
LogTopicType | - |
MaybeAbiEventName | - |
MaybeExtractEventArgsFromAbi | - |
MaybeRequired | - |
OutTransaction | The structure representing an outgoing transaction (a transaction created by a smart contract after another transaction triggers its execution). |
ProcessedReceipt | - |
ProcessedTransaction | The structure representing a processed transaction. |
ReadContractParameters | - |
ReadContractReturnType | - |
ReadContractsMethod | - |
Receipt | The receipt interface. |
RequestParams | Represents the params for making a request to the smart account. |
SendAbiTransactionParams | - |
SendBaseTransactionParams | - |
SendDataTransactionParams | - |
SendSyncAbiTransactionParams | - |
SendSyncBaseTransactionParams | - |
SendSyncDataTransactionParams | - |
SendSyncTransactionParams | Represents the params for sending a transaction synchronously. |
SendTransactionParams | Represents the params for sending a transaction. |
SmartAccountV1Config | Represents the smart account configuration. |
Token | The structure representing a custom token. |
TopUpParams | The parameters for the top up request. |
UnionEvaluate | - |
UnionToTuple | - |
UnionWiden | - |
Widen | - |
WriteContractParameters | - |
WriteContractsMethod | - |
WriteOptions | - |
Functions
Function | Description |
---|---|
addHexPrefix | Add the hex prefix to the hex string. |
bytesToHex | - |
bytesToString | Converts bytes to a string. |
calculateAddress | Calculates an address. |
concatHex | Concatenates an array of hex strings. The hex strings are concatenated without the "0x" prefix. The resulting hex string will have the "0x" prefix. |
contractInteraction | - |
convertEthToWei | - |
externalDeploymentTransaction | Creates a new external deployment transaction. |
externalTransactionEncode | Encodes the given external transaction. |
generateRandomKeyPair | Generate a new private key and its corresponding public key. |
generateRandomPrivateKey | Generate a new private key. |
generateSmartAccount | - |
getAddressFromPublicKey | Returns the address from the public key. |
getContract | - |
getPublicKey | Returns the public key from the private key using the secp256k1 curve. |
getShardIdFromAddress | Returns the ID of the shard containing the provided address. |
hexToBigInt | Converts a hex string to a bigint. |
hexToBytes | Converts a hex string to a byte array. |
hexToNumber | Converts a hex string to a number. |
isAddress | Checks if the value is an address. If the value is an address, returns true. Otherwise, returns false. |
isHexString | Checks if the value is a hex string. If the value is a hex string, returns true. Otherwise, returns false. |
mapReceipt | - |
poseidonHash | - |
prepareDeployPart | Refines the provided salt and generates the full bytecode for deployment. Returns the bytecode and the deployment address. |
privateKeyFromPhrase | Generate the private key from the mnemonic phrase. |
refineAddress | Refines the address. |
removeHexPrefix | Remove the hex prefix from the hex string. |
toHex | Converts a string, number, bigint, boolean, or ByteArrayType to a hex string. |
topUp | - |
waitTillCompleted | Makes it so that the client waits until the processing of the transaction whose hash is passed. |
writeContract | - |
writeExternalContract | - |