Skip to content

IntentProof/intentproof-sdk-go

Repository files navigation

intentproof-sdk-go

CI

Go SDK for signing IntentProof execution events locally.

Use

  • Configure, Wrap, RunWithCorrelationID, Flush
  • JCS canonicalization and Ed25519 signing
  • SQLite WAL outbox
  • Optional HTTP export for local dev loops only

Module

github.com/intentproof/intentproof-sdk-go

Install

go get github.com/intentproof/intentproof-sdk-go/intentproof

Test

go test ./...

Fixtures align with intentproof-spec.

Quick start

package main

import (
	"log"

	"github.com/intentproof/intentproof-sdk-go/intentproof"
)

func main() {
	if err := intentproof.Configure(intentproof.ConfigureOptions{
		DBPath:  "./intentproof-outbox.db",
		DataDir: "./.intentproof-sdk-go",
	}); err != nil {
		log.Fatal(err)
	}

	refund := intentproof.Wrap(
		"Return funds to the customer",
		"payments.refund.execute",
		func(input map[string]any) map[string]any {
			return map[string]any{"id": "re_123"}
		},
	)

	intentproof.RunWithCorrelationID("req_refund_ord_1042", func() {
		_ = refund(map[string]any{"amount_cents": 4999})
	})

	intentproof.Flush()
}

Default keys: ~/.intentproof/sdk-go/keypair.json.

Support

GitHub Issues — see CONTRIBUTING.md. Security reports: security@intentproof.io or a private GitHub Security Advisory.

License

MIT — see LICENSE.

About

Go SDK to sign IntentProof execution events locally (wrap/outbox). MIT.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors