Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maestro chain context #23

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ import (

"github.com/Salvionied/apollo/txBuilding/Backend/BlockFrostChainContext"
"github.com/Salvionied/apollo/txBuilding/Backend/FixedChainContext"
"github.com/Salvionied/apollo/txBuilding/Backend/MaestroChainContext"
)

/**
NewEmptyBackend creates and returns an empty FixedChainContext instance,
which is iused for cases where no specific backend context is required.
/*
*
NewEmptyBackend creates and returns an empty FixedChainContext instance,
which is iused for cases where no specific backend context is required.

Returns:
FixedChainContext.FixedChainContext: An empty FixedChainContext instance.
Returns:

FixedChainContext.FixedChainContext: An empty FixedChainContext instance.
*/
func NewEmptyBackend() FixedChainContext.FixedChainContext {
return FixedChainContext.InitFixedChainContext()
}

/**
/*
*

NewBlockfrostBackend creates a BlockFrostChainContext instance based
on the specified network and project ID.

Expand Down Expand Up @@ -68,3 +73,21 @@ func NewBlockfrostBackend(
return BlockFrostChainContext.BlockFrostChainContext{}, fmt.Errorf("Invalid network")
}
}

// NewMaestroBackend
// NewMaestroBackend creates a MaestroChainContext instance based on the specified network and project ID.
// Params:
// projectId (string): The project ID to authenticate with Maestro.
// network (Network): The network to configure the Maestro context for.
// Returns:
// MaestroChainContext.MaestroChainContext: A MaestroChainContext instance configured for the specified network.
func NewMaestroBackend(
projectId string,
network constants.Network,
) (MaestroChainContext.MaestroChainContext, error) {
return MaestroChainContext.NewMaestroChainContext(
int(network),
projectId,
)

}
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ require (
github.com/Salvionied/cbor/v2 v2.6.0
github.com/SundaeSwap-finance/kugo v0.1.5
github.com/SundaeSwap-finance/ogmigo v0.8.0
github.com/SundaeSwap-finance/ogmigo/v6 v6.0.0-20231101192200-2e052daaeb54
github.com/tyler-smith/go-bip39 v1.1.0
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/text v0.9.0
)

require (
github.com/SundaeSwap-finance/ogmigo/v6 v6.0.0-20231101192200-2e052daaeb54 // indirect
github.com/aws/aws-sdk-go v1.44.197 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
Expand All @@ -24,6 +24,9 @@ require (

require (
filippo.io/edwards25519 v1.0.0
github.com/maestro-org/go-sdk v1.1.3
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.8.0
)

replace github.com/maestro-org/go-sdk v1.1.2 => ./go-sdk
14 changes: 10 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/Salvionied/apollo v1.0.4 h1:fInThNTS10dBkPkP46diBjL9X3KKTIeon2eHhgDPYCE=
github.com/Salvionied/apollo v1.0.4/go.mod h1:OBwLhqLcjLE3pwYi0Z/oC2/9I1vpGLZGkstzDBOX6TI=
github.com/Salvionied/cbor/v2 v2.6.0 h1:OEwlZLiodLdNeM9wFoSydLvj6/rHRaxu5G8VzwXSeuY=
github.com/Salvionied/cbor/v2 v2.6.0/go.mod h1:oFxaUo/mQ5sG1k459nzctGdYa80jy0ZqZ9pln9C/fGw=
github.com/SundaeSwap-finance/kugo v0.1.4 h1:wgsqsnqY7gCs17eKX2BdjD/b3iUn8I0ct5JSMgRKWY0=
github.com/SundaeSwap-finance/kugo v0.1.4/go.mod h1:P3Hn7eqby5AdRmZkclFLLc3EQIIexEaVvfDZD6lcKQ8=
github.com/SundaeSwap-finance/kugo v0.1.5 h1:udigs4BdhFKNQqV2NW5oAma4Qhhenmh+3/jNLD9wDWQ=
github.com/SundaeSwap-finance/kugo v0.1.5/go.mod h1:P3Hn7eqby5AdRmZkclFLLc3EQIIexEaVvfDZD6lcKQ8=
github.com/SundaeSwap-finance/ogmigo v0.8.0 h1:cnta2oCuSwbFe/Wnc93lI+llz77GUrWCUpm+Vfj4HQc=
Expand All @@ -17,16 +13,24 @@ github.com/aws/aws-sdk-go v1.44.197/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88=
github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/maestro-org/go-sdk v1.1.3 h1:ORkeu1NXesRkdW7Pr5N956GojCibmGMdjXuO5jNAOZk=
github.com/maestro-org/go-sdk v1.1.3/go.mod h1:EYaRwFT8nkwFzZsN6xK256j+r7ASUUn9p44RlaqYjE8=
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
Expand Down Expand Up @@ -72,4 +76,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Loading
Loading