0.0.5 • Published 2 months ago

@aeternity-snap/sdk v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

@aeternity-snap/sdk

Interact with Aeternity Snap using the SDK, it's the easiest way to give Metamask users access to the world of Aeternity Protocol

import { AESnap, NetworkId } from "@aeternity-snap/sdk";
import { Encoding, Tag, encode } from "@aeternity/aepp-sdk";
import { TxParamsAsync } from "@aeternity/aepp-sdk/es/tx/builder/schema";

// Install snap and connect wallet
const snap = await AESnap.connect(NetworkId.testnet, {
  id: "local:http://localhost:8080",
});

// Get public key
const response = await snap?.getPublicKey();
console.log(response.publicKey ?? "No public key");

// Send transaction
const results = await snap.signAndSendTransaction({
  tag: Tag.SpendTx,
  senderId: "",
  recipientId: "",
  amount: 0.1 * 10 ** 18,
  payload: encode(new TextEncoder().encode(""), Encoding.Bytearray),
} as TxParamsAsync);
0.0.5

2 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.4

3 months ago

0.0.1

6 months ago