0.0.136 • Published 10 months ago

@hashgraphonline/standards-sdk v0.0.136

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
10 months ago

Hashgraph Online Standards SDK

A lightweight SDK providing reference implementations for Hashgraph Consensus Standards (HCS) created by Hashgraph Online.

Quick Start

npm install @hashgraphonline/standards-sdk

Documentation

For complete documentation, examples, and API references, visit:

Supported Standards

  • HCS-3: Recursion for Inscribed Files
  • HCS-7: Dynamic, Programmable, and 100% on-graph assets
  • HCS-10: Trustless, peer to peer communication for AI Agents
  • HCS-11: Profile Standard

Running Demos

The SDK includes demo implementations that showcase various features. Follow these steps to run them:

  1. Clone the repository

    git clone https://github.com/hashgraph-online/standards-sdk.git
    cd standards-sdk
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env
  4. Edit the .env file with your Hedera credentials:

    HEDERA_ACCOUNT_ID=0.0.12345
    HEDERA_PRIVATE_KEY=your_private_key_here
    HEDERA_NETWORK=testnet
    REGISTRY_URL=https://moonscape.tech

    Note: The SDK automatically saves agent creation progress to the .env file. If agent creation is interrupted, it will resume from the last successful step when you run the demo again. See .env.example for details on the auto-generated agent state variables.

  5. Run the demos:

    The following demo showcases inscribing a file.

    # Run the inscribe demo
    npm run demo:inscribe

    The following demo showcases registering Alice and Bob and exchanging messages between the two agents.

    # Run the HCS-10 AI agent communication demo
    npm run demo:hcs-10

    The following demo showcases a polling agent that polls an inbound topic for new messages with an OpenAI integration and simple commands.

    # Run the HCS-10 polling demo
    npm run demo:polling-agent

    The following demo showcases Foo and Bar agents exchanging messages where Foo also requires a fee to send messages to Bar's inbound topic:

    # Run the HCS-10 fee demo
    npm run demo:hcs-10-fee

Demo Descriptions

Inscribe Demo

The inscribe demo (demo/inscribe-demo.ts) showcases different file inscription capabilities:

  • Text inscription using buffers
  • URL-based inscriptions
  • File buffer inscriptions
  • Creating Hashinal NFTs from URLs
  • Creating Hashinal NFTs from buffers
  • Creating Hashinal NFTs from text content

Each inscription demonstrates different options and metadata capabilities.

HCS-10 AI Agent Communication Demo

The HCS-10 demo (demo/hcs-10/index.ts) demonstrates trustless peer-to-peer communication between AI agents:

  • Agent creation and registration (Alice and Bob)
  • Agent metadata and profile management
  • Connection establishment between agents
  • Sending and retrieving small messages
  • Sending and retrieving large messages with recursive storage
  • Message data processing
  • Resumable agent creation: If agent creation is interrupted, the SDK automatically resumes from where it left off using state saved in environment variables

The demo automatically handles agent funding, topic creation, and registration with the global registry. Agent creation progress is tracked in real-time and saved to the .env file, allowing recovery from any interruption.

Contributing

Please read our Contributing Guide and Code of Conduct before contributing to this project.

For bugs and feature requests, please use the issue templates.

Security

For security concerns, please refer to our Security Policy.

Maintainers

See MAINTAINERS.md for a list of project maintainers.

Resources

License

Apache-2.0

0.0.136

10 months ago

0.0.134

10 months ago

0.0.133

10 months ago

0.0.132

10 months ago

0.0.131

10 months ago

0.0.130

10 months ago

0.0.129

10 months ago

0.0.128

10 months ago

0.0.127

10 months ago

0.0.126

10 months ago

0.0.125

10 months ago

0.0.124

10 months ago

0.0.123

10 months ago

0.0.122

10 months ago

0.0.121

10 months ago

0.0.120

10 months ago

0.0.119

10 months ago

0.0.118

10 months ago

0.0.117

10 months ago

0.0.116

10 months ago

0.0.115

10 months ago

0.0.114

10 months ago

0.0.113

10 months ago

0.0.112

10 months ago

0.0.112-canary.4

10 months ago

0.0.112-canary.3

10 months ago

0.0.112-canary.2

10 months ago

0.0.112-canary.0

10 months ago

0.0.111

10 months ago

0.0.109

10 months ago

0.0.108-canary.3

10 months ago

0.0.108-canary.1

10 months ago

0.0.108-canary.0

10 months ago

0.0.107

10 months ago

0.0.106

10 months ago

0.0.105

10 months ago

0.0.104

10 months ago

0.0.103

10 months ago

0.0.102

10 months ago

0.0.101

10 months ago

0.0.100

10 months ago

0.0.99

10 months ago

0.0.98

10 months ago

0.0.97

11 months ago

0.0.96

11 months ago

0.0.95

11 months ago

0.0.94

11 months ago

0.0.93

11 months ago

0.0.92

11 months ago

0.0.91

11 months ago

0.0.90

11 months ago

0.0.89

11 months ago

0.0.88

11 months ago

0.0.87

11 months ago

0.0.86

11 months ago

0.0.85

11 months ago

0.0.84

11 months ago

0.0.83

11 months ago

0.0.82

11 months ago

0.0.81

11 months ago

0.0.80

11 months ago

0.0.79

11 months ago

0.0.78

12 months ago

0.0.77

12 months ago

0.0.76

12 months ago

0.0.75

12 months ago

0.0.74

12 months ago

0.0.73

12 months ago

0.0.72

12 months ago

0.0.70

12 months ago

0.0.69

12 months ago

0.0.68

12 months ago

0.0.67

12 months ago

0.0.66

12 months ago

0.0.65

12 months ago

0.0.64

12 months ago

0.0.63

12 months ago

0.0.62

12 months ago

0.0.61

12 months ago

0.0.60

12 months ago

0.0.59

12 months ago

0.0.58

12 months ago

0.0.57

12 months ago

0.0.56

12 months ago

0.0.55

12 months ago

0.0.54

12 months ago

0.0.53

12 months ago

0.0.52

12 months ago

0.0.51

12 months ago

0.0.50

12 months ago

0.0.49

12 months ago

0.0.48

12 months ago

0.0.47

12 months ago

0.0.46

1 year ago

0.0.45

1 year ago

0.0.44

1 year ago

0.0.43

1 year ago

0.0.42

1 year ago

0.0.41

1 year ago

0.0.40

1 year ago

0.0.38

1 year ago

0.0.37

1 year ago

0.0.36

1 year ago

0.0.35

1 year ago

0.0.34

1 year ago

0.0.33

1 year ago

0.0.32

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.29

1 year ago

0.0.28

1 year ago

0.0.27

1 year ago

0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago