Skip to content

Commit

Permalink
Merge branch 'BUX-705/Gitbook' of https://github.com/bitcoin-sv/go-pa…
Browse files Browse the repository at this point in the history
…ymail into BUX-705/Gitbook
  • Loading branch information
Nazarii-4chain committed Apr 2, 2024
2 parents edcc6cf + 4893431 commit 0a21703
Show file tree
Hide file tree
Showing 30 changed files with 523 additions and 313 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [0.14.0](https://github.com/bitcoin-sv/go-paymail/compare/v0.13.0...v0.14.0) (2024-03-26)


### Features

* **BUX-395:** add pike capabilitiy ([#77](https://github.com/bitcoin-sv/go-paymail/issues/77)) ([3c6789d](https://github.com/bitcoin-sv/go-paymail/commit/3c6789d1352cba6297076b7c11650b5c06334bc6))

## [0.13.0](https://github.com/bitcoin-sv/go-paymail/compare/v0.12.1...v0.13.0) (2024-02-26)


### Features

* **223:** replace router with gin ([#74](https://github.com/bitcoin-sv/go-paymail/issues/74)) ([9d9f3e7](https://github.com/bitcoin-sv/go-paymail/commit/9d9f3e7dc2706c0fceba7399f6afaadc504cf947))

## [0.12.1](https://github.com/bitcoin-sv/go-paymail/compare/v0.12.0...v0.12.1) (2024-01-22)


Expand Down
11 changes: 10 additions & 1 deletion brfc_definintions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const (
BRFCSFPBuildAction = "189e32d93d28" // more info: https://docs.moneybutton.com/docs/sfp/paymail-09-sfp-build.html
BRFCVerifyPublicKeyOwner = "a9f510c16bde" // more info: http://bsvalias.org/05-verify-public-key-owner.html
BRFCBeefTransaction = "5c55a7fdb7bb" // more info: https://bsv.brc.dev/payments/0070

BRFCPike = "8c4ed5ef8ace" // more info: TODO BUX-665
)

// BRFCKnownSpecifications is a running list of all known BRFC specifications
Expand Down Expand Up @@ -196,6 +198,13 @@ const BRFCKnownSpecifications = `
"title": "Background Evaluation Extended Format Transaction",
"url": "https://bsv.brc.dev/payments/0070",
"version": "1.0.0"
}
},
{
"author": "Damian Orzepowski",
"id": "8c4ed5ef8ace",
"title": "PIKE",
"url": "TODO",
"version": "1.0.0"
}
]
`
8 changes: 8 additions & 0 deletions examples/server/run_server/demo_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ func (d *demoServiceProvider) VerifyMerkleRoots(ctx context.Context, merkleProof
// Verify the Merkle roots
return nil
}

func (d *demoServiceProvider) AddContact(
ctx context.Context,
requesterPaymail string,
contact *paymail.PikeContactRequestPayload,
) error {
return nil
}
18 changes: 11 additions & 7 deletions examples/server/run_server/run_server.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package main

import (
"encoding/json"
"fmt"
"net/http"
"time"

"github.com/gin-gonic/gin"

"github.com/bitcoin-sv/go-paymail/logging"

"github.com/bitcoin-sv/go-paymail/server"
"github.com/julienschmidt/httprouter"
)

func main() {
Expand All @@ -20,9 +20,13 @@ func main() {
logger.Fatal().Msg(err.Error())
}

sl := server.PaymailServiceLocator{}
sl.RegisterPaymailService(new(demoServiceProvider))
sl.RegisterPikeService(new(demoServiceProvider))

// Custom server with lots of customizable goodies
config, err := server.NewConfig(
new(demoServiceProvider),
&sl,
server.WithBasicRoutes(),
server.WithDomain("localhost"),
server.WithDomain("another.com"),
Expand Down Expand Up @@ -51,15 +55,15 @@ func customCapabilities() map[string]any {
"custom_callable_cap": server.CallableCapability{
Path: fmt.Sprintf("/display_paymail/%s", server.PaymailAddressTemplate),
Method: http.MethodGet,
Handler: func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
incomingPaymail := p.ByName(server.PaymailAddressParamName)
Handler: func(c *gin.Context) {
incomingPaymail := c.Param(server.PaymailAddressParamName)

response := map[string]string{
"paymail": incomingPaymail,
}

w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(response)
c.Header("Content-Type", "application/json")
c.JSON(http.StatusOK, response)
},
},
}
Expand Down
34 changes: 24 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,51 @@ go 1.21.5

require (
github.com/bitcoinschema/go-bitcoin/v2 v2.0.5
github.com/gin-gonic/gin v1.9.1
github.com/go-resty/resty/v2 v2.11.0
github.com/jarcoal/httpmock v1.3.1
github.com/julienschmidt/httprouter v1.3.0
github.com/libsv/go-bc v0.1.25
github.com/libsv/go-bk v0.1.6
github.com/libsv/go-bt/v2 v2.2.5
github.com/miekg/dns v1.1.57
github.com/newrelic/go-agent/v3/integrations/nrhttprouter v1.0.2
github.com/rs/zerolog v1.31.0
github.com/stretchr/testify v1.8.4
go.elastic.co/ecszerolog v0.2.0
golang.org/x/net v0.19.0
golang.org/x/net v0.21.0
)

require (
github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 // indirect
github.com/bytedance/sonic v1.10.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.18.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/libsv/go-p2p v0.1.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/newrelic/go-agent/v3 v3.29.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 0a21703

Please sign in to comment.