
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@aptos-labs/ts-sdk
Advanced tools
This library is experimental. Therefore, the API is unstable and may change without warning.
The Aptos TypeScript SDK provides a convenient way to interact with the Aptos blockchain using TypeScript. It offers a set of utility functions, classes, and types to simplify the integration process and enhance developer productivity.
This repository supports version >= 0.0.0 of the Aptos SDK npm package.
Install with your favorite package manager such as npm, yarn, or pnpm:
pnpm install @aptos-labs/ts-sdk@experimental
You can add the SDK to your web application using a script tag:
<script src="https://unpkg.com/@aptos-labs-ts-sdk@experimental/dist/browser/index.global.js" />
Then, the SDK can be accessed through window.aptosSDK
.
Initialize Aptos
to access the SDK API.
// initiate the main entry point into Aptos SDK
const aptos = new Aptos();
If you want to pass in a costum config
// an optional config information for the SDK client instance.
const config = new AptosConfig({ network: Network.LOCAL });
const aptos = new Aptos(config);
const modules = await aptos.getAccountModules({ accountAddress: "0x123" });
Using transaction submission api
const alice: Account = Account.generate();
const bobAddress = "0xb0b";
const transaction = await aptos.generateTransaction({
sender: alice.accountAddress.toString(),
data: {
function: "0x1::coin::transfer",
type_arguments: [new TypeTagStruct(StructTag.fromString("0x1::aptos_coin::AptosCoin"))],
arguments: [AccountAddress.fromHexInput(bobAddress), new U64(100)],
},
});
let committedTransaction = await aptos.signAndSubmitTransaction({ signer: alice, transaction });
Using built in transferCoinTransaction
const alice: Account;
const bobAddress = "0xb0b";
const transaction = await aptos.transferCoinTransaction({
sender: alice.accountAddress.toString(),
recipient: bob,
amount: 100,
});
const pendingTransaction = await aptos.signAndSubmitTransaction({ signer: alice, transaction });
const account = Account.generate();
const account = Account.fromPrivateKey("0x123");
const path = "m/44'/637'/0'/0'/1";
const mnemonic = "various float stumble...";
const account = Account.fromDerivationPath({ path, mnemonic });
package.json
files to get you going quickly!To run the SDK tests, simply run from the root of this repository:
Note: make sure aptos local node is up and running. Take a look at the local development network guide for more details.
pnpm test
If you found a bug or would like to request a feature, please file an issue. If, based on the discussion on an issue you would like to offer a code change, please make a pull request. If neither of these describes what you would like to contribute, checkout out the contributing guide.
FAQs
Aptos TypeScript SDK
The npm package @aptos-labs/ts-sdk receives a total of 55,030 weekly downloads. As such, @aptos-labs/ts-sdk popularity was classified as popular.
We found that @aptos-labs/ts-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.