
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
This Is The official JavaScript/TypeScript SDK for Aptick - a decentralized billing system built on the Aptos blockchain.
npm install aptick-sdk
# or
yarn add aptick-sdk
# or
pnpm add aptick-sdk
import { createAptickClient, AptickConfig } from 'aptick-sdk';
const config: AptickConfig = {
network: 'devnet', // or 'mainnet', 'testnet', 'local'
contractAddress: '0x123...', // Optional: defaults to official deployed contracts
};
const client = createAptickClient(config);
await client.initialize();
Once you've registered on the Aptick platform and received your billing ID:
npm install aptick-sdkimport { AptickProvider, useAptick, setupAptick } from 'aptick-sdk';
import { useWallet } from '@aptos-labs/wallet-adapter-react';
// Setup the client
const client = await setupAptick({ network: 'devnet' });
// Wrap your app
function App() {
return (
<AptickProvider client={client}>
<YourComponents />
</AptickProvider>
);
}
// Use in components
function ProviderRegistration() {
const client = useAptick();
const { signAndSubmitTransaction } = useWallet();
const handleRegister = async () => {
const result = await client.registerProvider(
signAndSubmitTransaction,
0.001, // 0.001 APT per unit
'GB' // Unit type
);
if (result.success) {
console.log('Registered with billing ID:', result.data);
}
};
return <button onClick={handleRegister}>Register as Provider</button>;
}
AptickClientThe main client for interacting with the Aptick billing system.
// Initialize
const client = new AptickClient(config);
await client.initialize();
// Register as provider
const result = await client.registerProvider(walletSignFn, pricePerUnit, unit);
// Deposit APT
await client.deposit(walletSignFn, billingId, aptAmount);
// Record usage (providers only)
await client.recordUsage(walletSignFn, billingId, userAddress, units);
// Terminate service and get refund
await client.terminateService(walletSignFn, billingId);
// Query data
const provider = await client.getProvider(billingId);
const escrow = await client.getUserEscrow(billingId, userAddress);
const balance = await client.getAptBalance(address);
AptickUtilsUtility functions for common operations.
import { AptickUtils } from 'aptick-sdk';
// Convert between APT and octas
const octas = AptickUtils.aptToOctas(1.5); // 150,000,000 octas
const apt = AptickUtils.octasToApt(150000000n); // 1.5
// Format for display
const formatted = AptickUtils.formatApt(150000000n); // "1.5000 APT"
// Validate addresses
const isValid = AptickUtils.isValidAddress('0x123...');
// Calculate costs
const cost = AptickUtils.calculateCost(10n, 1000n); // 10 units × 1000 octas = 10000 octas
useProviderRegistrationimport { useProviderRegistration } from 'aptick-sdk';
const { registerProvider } = useProviderRegistration(client);
await registerProvider(signAndSubmitTransaction, 0.001, 'GB');
useUserOperationsimport { useUserOperations } from 'aptick-sdk';
const { deposit, terminateService } = useUserOperations(client);
await deposit(signAndSubmitTransaction, billingId, 1.0);
await terminateService(signAndSubmitTransaction, billingId);
useProviderOperationsimport { useProviderOperations } from 'aptick-sdk';
const { recordUsage } = useProviderOperations(client);
await recordUsage(signAndSubmitTransaction, billingId, userAddress, 10);
useAptickQueryimport { useAptickQuery } from 'aptick-sdk';
const { getProvider, getUserEscrow, getAptBalance } = useAptickQuery(client);
const provider = await getProvider(billingId);
const escrow = await getUserEscrow(billingId, userAddress);
const balance = await getAptBalance(address);
import { createAptickClient, AptickUtils } from 'aptick-sdk';
import { useWallet } from '@aptos-labs/wallet-adapter-react';
async function registerAsProvider() {
const client = createAptickClient({ network: 'devnet' });
await client.initialize();
const { signAndSubmitTransaction } = useWallet();
// Validate inputs
const validation = AptickUtils.validateBillingParams(0.001, 'GB');
if (!validation.valid) {
throw new Error(validation.error);
}
// Register
const result = await client.registerProvider(
signAndSubmitTransaction,
0.001, // 0.001 APT per GB
'GB' // Gigabyte
);
if (result.success) {
console.log(`Registered! Billing ID: ${result.data}`);
console.log(`Transaction: ${result.transactionHash}`);
} else {
console.error(`Registration failed: ${result.error}`);
}
}
async function userFlow() {
const client = createAptickClient({ network: 'devnet' });
await client.initialize();
const { signAndSubmitTransaction } = useWallet();
const billingId = 1;
const userAddress = '0x123...';
// Check balance before
const beforeBalance = await client.getAptBalance(userAddress);
console.log(`Balance: ${AptickUtils.formatApt(beforeBalance.data!)}`);
// Deposit 1 APT
await client.deposit(signAndSubmitTransaction, billingId, 1.0);
// Check escrow
const escrow = await client.getUserEscrow(billingId, userAddress);
console.log(`Escrow: ${AptickUtils.formatApt(escrow.data!.balance)}`);
// Provider records usage (10 GB)
// This would be called by the provider
await client.recordUsage(signAndSubmitTransaction, billingId, userAddress, 10);
// Terminate and get refund
await client.terminateService(signAndSubmitTransaction, billingId);
}
All SDK methods return AptickResult<T> objects:
interface AptickResult<T> {
success: boolean;
data?: T;
error?: string;
transactionHash?: string;
}
// Always check success
const result = await client.registerProvider(/* ... */);
if (result.success) {
console.log('Success:', result.data);
} else {
console.error('Error:', result.error);
}
const config: AptickConfig = {
network: 'devnet',
contractAddress: '0x123...', // Optional
moduleAccount: 'billing', // Optional
rpcUrl: 'https://...', // Optional
};
const options: TransactionOptions = {
maxGasAmount: 10000,
gasUnitPrice: 100,
timeoutSecs: 30,
};
await client.registerProvider(walletSignFn, pricePerUnit, unit, options);
See CONTRIBUTING.md for details.
MIT License - see LICENSE for details.
FAQs
Official SDK for Aptick - Decentralized Billing System on Aptos
We found that aptick-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.