@aptos-labs/ts-sdk
Version:
Aptos TypeScript SDK
106 lines (103 loc) • 3.23 kB
text/typescript
import { AccountAddress } from '../core/accountAddress.mjs';
import { Network } from '../utils/apiEndpoints.mjs';
import '../bcs/serializer.mjs';
import '../core/hex.mjs';
import '../core/common.mjs';
import '../types/index.mjs';
import '../types/indexer.mjs';
import '../types/generated/operations.mjs';
import '../types/generated/types.mjs';
import '../bcs/deserializer.mjs';
import '../transactions/instances/transactionArgument.mjs';
declare class Move {
/**
* Function to initialize current directory for Aptos
*
* Configuration will be pushed into .aptos/config.yaml
* @param args.network optional Netowrk type argument to use for default settings, default is local
* @param args.profile optional Profile to use from the config file, default is 'default'
* This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.
*
* @returns
*/
init(args: {
network?: Network;
profile?: string;
}): Promise<boolean>;
/**
* Function to compile a package
*
* @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)
* @param args.namedAddresses Named addresses for the move binary
* @example
* {
* alice:0x1234, bob:0x5678
* }
*
* @returns
*/
compile(args: {
packageDirectoryPath: string;
namedAddresses: Record<string, AccountAddress>;
}): Promise<boolean>;
/**
* Function to run Move unit tests for a package
*
* @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)
* @param args.namedAddresses Named addresses for the move binary
* @example
* {
* alice:0x1234, bob:0x5678
* }
*
* @returns
*/
test(args: {
packageDirectoryPath: string;
namedAddresses: Record<string, AccountAddress>;
}): Promise<boolean>;
/**
* Function to publishe the modules in a Move package to the Aptos blockchain
*
* @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)
* @param args.namedAddresses Named addresses for the move binary
* @example
* {
* alice:0x1234, bob:0x5678
* }
* @param args.profile optional Profile to use from the config file.
*
* @returns
*/
publish(args: {
packageDirectoryPath: string;
namedAddresses: Record<string, AccountAddress>;
profile?: string;
}): Promise<boolean>;
/**
* Run a move command
*
* @param args
* @returns
*/
private runCommand;
/**
* Convert named addresses from a Map into an array seperated by a comma
*
* @example
* input: {'alice' => '0x123', 'bob' => '0x456'}
* output: "alice=0x123,bob=0x456"
*
* @param namedAddresses
* @returns An array of names addresses seperated by a comma
*/
private prepareNamedAddresses;
/**
* Parse named addresses from a Record type into a Map
*
* @param namedAddresses
* @returns Map<name,address>
*/
private parseNamedAddresses;
}
export { Move };