An SDK to interact with stellar-turrets
npm:
npm install stellar-turret-sdk
yarn:
yarn add stellar-turret-sdk
import { TurretSDK } from 'stellar-turret-sdk';
import path from 'path';
(async () => {
// Turret configuration to initialize.
const config = { domain_name: 'WORKER URL', auth_key: 'ACCOUNT SECRET KEY' }
const turret = new TurretSDK(config);
// After creating the class you need to run setup method.
await turret.setup()
// Path to contract file.
const contractPath = path.join(__dirname, "path/to/file")
// Array with function fields.
const txFunctionFields = [
{
name: 'name',
type: 'string',
description: 'This is a param',
rule: 'Required'
}
]
return await turret.uploadContract(contractPath, txFunctionFields);
})()
// script