Adds a profile account to the profile account map.
The name of the profile to associate with the account.
The Ed25519 private key of the account to add.
Adds a profile address to the profile address map.
The name of the profile to associate with the address.
The account address to be added.
Retrieves the ACL (Access Control List) profile account.
The ACL profile account.
Retrieves the Aptos instance.
The Aptos instance.
Retrieves the profile account associated with AAVE A_TOKENS.
The Ed25519 account corresponding to the A_TOKENS profile.
Retrieves the data profile account associated with the AAVE_DATA profile.
The Ed25519 account corresponding to the AAVE_DATA profile.
Retrieves the current network configuration.
The network configuration.
Retrieves the Oracle profile account.
This method returns an Ed25519Account
instance associated with the
AAVE Oracle profile. It internally calls getProfileAccountByName
with the AAVE_ORACLE
profile name to fetch the account details.
The Oracle profile account.
Retrieves the Ed25519 account associated with the AAVE pool profile.
The Ed25519 account for the AAVE pool profile.
Retrieves the profile account associated with the given profile name.
The name of the profile whose account is to be retrieved.
An instance of Ed25519Account
if the profile account exists, otherwise undefined
.
Retrieves the private key associated with a given profile name.
The name of the profile whose private key is to be retrieved.
The Ed25519 private key associated with the specified profile name.
Retrieves the account address associated with the given profile name.
The name of the profile whose account address is to be retrieved.
The account address associated with the given profile name.
Retrieves the profile account associated with underlying tokens.
The profile account for underlying tokens.
Retrieves the profile account associated with variable tokens.
The Ed25519 account corresponding to the variable tokens profile.
Sets the Aptos configuration for the client.
The configuration object for Aptos.
Sets the network for the Aptos provider.
The network to set, represented by the Network
type.
Static
fromCreates an instance of AptosProvider
from a YAML string.
This method parses the provided YAML string to extract profile configurations,
sets the network for the AptosProvider
based on the profile's network configuration,
and adds profile accounts and addresses to the provider.
The YAML string containing the Aptos profile configurations.
An instance of AptosProvider
configured based on the provided YAML.
Static
fromCreates an instance of AptosProvider
from the given configuration.
The configuration object for the AptosProvider
.
A new instance of AptosProvider
configured with the provided settings.
const config: AptosProviderConfig = {
network: 'mainnet',
addresses: {
A_TOKENS: '0x...',
AAVE_MOCK_UNDERLYINGS: '0x...',
VARIABLE_TOKENS: '0x...',
AAVE_ACL: '0x...',
AAVE_CONFIG: '0x...',
AAVE_ORACLE: '0x...',
AAVE_POOL: '0x...',
AAVE_DATA: '0x...'
}
};
const aptosProvider = AptosProvider.fromConfig(config);
Static
fromCreates an instance of AptosProvider
by reading configuration from environment variables.
The configured AptosProvider
instance.
Environment Variables:
APTOS_NETWORK
: The network to connect to (testnet, devnet, mainnet, local).A_TOKENS_PRIVATE_KEY
: Private key for A_TOKENS profile.AAVE_MOCK_UNDERLYING_TOKENS_PRIVATE_KEY
: Private key for UNDERLYING_TOKENS profile.VARIABLE_TOKENS_PRIVATE_KEY
: Private key for VARIABLE_TOKENS profile.AAVE_ACL_PRIVATE_KEY
: Private key for AAVE_ACL profile.AAVE_CONFIG_PRIVATE_KEY
: Private key for AAVE_CONFIG profile.AAVE_ORACLE_PRIVATE_KEY
: Private key for AAVE_ORACLE profile.AAVE_POOL_PRIVATE_KEY
: Private key for AAVE_POOL profile.AAVE_LARGE_PACKAGES_PRIVATE_KEY
: Private key for AAVE_LARGE_PACKAGES profile.AAVE_MATH_PRIVATE_KEY
: Private key for AAVE_MATH profile.AAVE_DATA_PRIVATE_KEY
: Private key for AAVE_DATA profile.DEFAULT_FUNDER_PRIVATE_KEY
: Private key for DEFAULT_FUNDER profile.TEST_ACCOUNT_0_PRIVATE_KEY
: Private key for TEST_ACCOUNT_0 profile.TEST_ACCOUNT_1_PRIVATE_KEY
: Private key for TEST_ACCOUNT_1 profile.TEST_ACCOUNT_2_PRIVATE_KEY
: Private key for TEST_ACCOUNT_2 profile.TEST_ACCOUNT_3_PRIVATE_KEY
: Private key for TEST_ACCOUNT_3 profile.TEST_ACCOUNT_4_PRIVATE_KEY
: Private key for TEST_ACCOUNT_4 profile.TEST_ACCOUNT_5_PRIVATE_KEY
: Private key for TEST_ACCOUNT_5 profile.
The
AptosProvider
class is responsible for managing the configuration and profiles for interacting with the Aptos blockchain. It allows setting up network configurations, adding profile addresses and accounts, and initializing the Aptos instance.