API Methods
Utility Methods
Signature Generation
Before using the API methods that require signatures, you'll need to generate them using the provided utility functions:
import { signMessage, toHex } from '@1money/ts-sdk';
// Your private key (DO NOT share or commit your private key)
const privateKey = 'YOUR_PRIVATE_KEY';
// Example: Generate signature for a payment transaction
const paymentPayload = [
toHex(1), // chain_id
toHex(1), // nonce
'0x2cd8999Be299373D7881f4aDD11510030ad1412F', // recipient
toHex('1000000000'), // value
'0x2cd8999Be299373D7881f4aDD11510030ad1412F', // token
];
const signature = signMessage(paymentPayload, privateKey);
if (!signature) {
throw new Error('Failed to generate signature');
}
// The signature object will have the correct r, s, v format
console.log('Generated signature:', signature);
// Output example:
// {
// r: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
// s: '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',
// v: 27
// }Get Account Nonce
Get Token Metadata
Get Current Checkpoint
Transaction Methods
Estimate Transaction Fee
Get Transaction Details
Get Transaction Receipt
Payment Methods
Submit Payment Transaction
Cancel Transaction
Token Management Methods
Issue New Token
Mint Tokens
Burn Tokens
Update Token Metadata
Set Token Blacklist Status
Grant Token Authority
Pause/Unpause Token
Last updated