Socket
Book a DemoInstallSign in
Socket

@eversdk/net

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eversdk/net

Collection of network providers for TVM Blockchains

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
2
Created
Source

@eversdk/smc

TON

Collection of network providers for TVM Blockchains.

How to install

yarn add @eversdk/net or npm i @eversdk/net

Simple usage

CloudProvider provides methods with type wrappers, such as sendExternalMessage:

import { Builder } from '@eversdk/ton'
import { CloudProvider } from '@eversdk/net'

async function main () {
    // usage of https://www.evercloud.dev
    const provider = new CloudProvider({
        endpoint: 'https://mainnet.evercloud.dev/.../graphql'
    })

    const c = new Builder().cell()
    await provider.sendExternalMessageCell(c)
}

main()

For extended usage of CloudProvider (evercloud graphql), use graphql code generation with the-guild and @apollo/client.

import { CloudProvider } from '@eversdk/net'
import { graphql } from './codegen/generated'

// ./codegen/generated –> path to the-guild codegen result

const getBalance = apollo.graphql(`
    query getBalance($address: String!) {
        blockchain {
            account (address: $address) {
                info { balance(format: DEC) }
            }
        }
    }
`)

async function main () {
    const provider = new CloudProvider({
        endpoint: 'https://mainnet.evercloud.dev/.../graphql'
    })

    const address = '0:0000000000000000000000000000000000000000000000000000000000000000'

    const result = await provider.client.query({
        query: getBalance,
        variables: { address }
    })

    // fully typed result based on the graphql schema
    console.log(result.data.blockchain?.account?.info?.balance)
}

main()

External dependencies

  • "@apollo/client": "3.7.14"
  • "@eversdk/ton": "0.1.0"
  • "graphql": "16.6.0"

License

MIT

Keywords

tvm

FAQs

Package last updated on 24 May 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.