tymt-launcher-sdk
v1.0.0
Published
To install tymt SDK, use npm or yarn: #### `npm install tymtsdk` #### `yarn add tymtsdk`
Downloads
2
Readme
tymt SDK Developer Guide
Installation
To install tymt SDK, use npm or yarn:
npm install tymtsdk
yarn add tymtsdk
Usage
Initialization
First, you need to import and initialize the TymtSDK class.
import TymtSDK from 'tymtsdk';
const tymt = new TymtSDK();
Connecting with a Token
Use the connect
method to authenticate with the service using a token, before using other methods.
tymt.connect(token);
Using TymtSDK functions
You can use these functions after authentication.
- tymt.getAccount(data) function
Example:
try {
const data: GetAccountReqType = {
chain: 'solar'
}
const account = await tymt.getAccount(data);
console.log(account);
} catch (error) {
console.error('Error:', error);
}
- tymt.getAccount(data) function
Example:
try {
const data: GetAccountReqType = {
chain: 'solar'
}
const account = await tymt.getAccount(data);
console.log(account);
} catch (error) {
console.error('Error:', error);
}
- tymt.requestNewOrder(data) function
Example:
try {
const data: SendTransactionReqType = {
chain: "solar",
transfers: [
{
to: "ShBFi7rZAvj5QCLszCu9AeDxSxAXxPP2ZT",
amount: "100"
}
],
note: "Hello world",
memo: "Test memo",
status: "pending",
transaction: "Test txid"
}
const order = await tymt.requestNewOrder(data);
console.log(order);
} catch (error) {
console.error('Error:', error);
}
- Use tymt.executeOrder(data)
Example:
try {
const data: ExecuteOrderReqType = {
id: '66815c6e134d2ac633d041e4'
}
const order = await tymt.executeOrder(data);
console.log(order);
} catch (error) {
console.error('Error:', error);
}
Publishing
npm publish