Socket
Socket
Sign inDemoInstall

@seda-protocol/as-sdk

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seda-protocol/as-sdk

SDK for creating Oracle Programs on the SEDA chain.


Version published
Maintainers
0
Created
Source

AssemblyScript SDK

SDK for creating Oracle Programs on the SEDA chain.

For guides an examples on how to use this SDK see our documentation: <LINK_HERE>

Preview

import { Process, httpFetch, Bytes, OracleProgram, Console, JSON } from "@seda-protocol/as-sdk/assembly";

@json
class SwPlanet {
  name!: string;
}

class PlanetProgram extends OracleProgram {
  execute(): void {
    const response = httpFetch("https://swapi.dev/api/planets/1/");

    if (response.ok) {
      const planet = response.bytes.toJSON<SwPlanet>();

      Console.log(planet);

      Process.success(Bytes.fromUtf8String(planet.name));
    } else {
      Process.error(Bytes.fromUtf8String("Error while fetching"));
    }
  }
}

new PlanetProgram().run();

FAQs

Package last updated on 19 Sep 2024

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