0.0.16 • Published 9 months ago

@seda-protocol/as-sdk v0.0.16

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

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();
0.0.16

9 months ago

0.0.11

10 months ago

0.0.12

10 months ago

0.0.13

10 months ago

0.0.14

10 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.15

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.5

10 months ago

0.0.4

12 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.1

2 years ago