7. Match Orders
Initialize SDK
Match Orders
package main
import (
"fmt"
"github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk"
)
func main() {
accountName := "Alice"//Zecrey NFT Marketplace SDK will automatically add the suffix ".zec" to the name
seed := "0x6a1a320d14790f2d9aa9a37769f4833d583a3f7f974fd452a3990aeb0e7a6052" //l2 seed
var offerId int64 = 31 //select a listed NFT
AssetAmount = big.NewInt(1000000000000000000) //the amount used to purchase
isSell := false
c, err := sdk.NewClient(accountName, seed)
if err != nil { panic(err) }
result, err := c.AcceptOffer(offerId, isSell, AssetAmount)//false represents "buy" while true represents "sell"
if err != nil { panic(err) }
data, _ := json.Marshal(result)
fmt.Println(string(data))
}Last updated
Was this helpful?