Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pte-sdk

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pte-sdk

This is Typescript/Javascript library for accessing the Babylon Public Test Environment (PTE).

  • 0.1.28
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

PTE SDK

This is a Typescript library for constructing manifest and interacting with Babylon PTE service.

Example Use

import { ManifestBuilder, DefaultApi } from "pte-sdk";

const manifest = new ManifestBuilder()
    .callMethod('02e97040eb89efb88acc32577cecd380319c14777ea2aa98cddfad', 'withdraw_by_amount', [
        'Decimal("1")',
        'ResourceAddress("resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag")'
    ])
    .takeFromWorktop('resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag', 'xrd_bucket')
    .callMethod('0290b7cbb58c5b43cf0e99534e8161bd7ce561c090adc0fdacac88', 'buy_gumball', [
        'Bucket("xrd_bucket")'
    ])
    .callMethodWithAllResources('02e97040eb89efb88acc32577cecd380319c14777ea2aa98cddfad', 'deposit_batch')
    .build();

const api = new DefaultApi();
const receipt = await api.submitTransaction({
    transaction: {
        manifest: manifest.toString(),
        nonce: {
            value: 4083048708
        },
        signatures: [
            {
                publicKey: '04704ab82d9f5791ba46a134e5c1f08bf131adf53ab7e9c39eb3784ab35be7880432af5bbd67232d4d15b40a6cd676aa69568b95e754c79274648d80b95c4185b0',
                signature: '051dc7a42a3ba8ebd3608913c1dfd424601acaa3a5ef33de6288233d2fedb7c33849aecc8ef2c50ae75af5ea9cec1ecd6f04d2ddd0b07f6c79078c161ee56335'
            }
        ]
    }
})

console.log(receipt);

Build

npm install
npm run build

Test

npm run test

FAQs

Package last updated on 12 Sep 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc