From 4eee7dbbd78e5e9114fa894a67e055ac6af95717 Mon Sep 17 00:00:00 2001 From: sandy <18382255942@163.com> Date: Fri, 2 Feb 2024 18:02:07 +0800 Subject: [PATCH 1/2] feat(): test --- sdk/sdk_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go index 57798a2..8107ba5 100644 --- a/sdk/sdk_test.go +++ b/sdk/sdk_test.go @@ -164,7 +164,7 @@ func TestSDK_SendDataStreamAndPay(t *testing.T) { func TestSDK_PayOrders_BundlePay(t *testing.T) { payUrl := "https://api.everpay.io" - seedUrl := "https://seed-dev.everpay.io" + seedUrl := "https://arseed.web3infra.dev" eccSigner, err := goether.NewSigner("") if err != nil { @@ -174,23 +174,23 @@ func TestSDK_PayOrders_BundlePay(t *testing.T) { if err != nil { panic(err) } - data := []byte("sandy test bundle pay") + data := []byte("sandy test bundle pay 1111111") tags := []types.Tag{ {"Content-Type", "text"}, } rewards := []schema.Reward{ { - Tag: "conflux-cfx-0x0000000000000000000000000000000000000000", + Tag: "bsc-bnb-0x0000000000000000000000000000000000000000", Recipient: "cSYOy8-p1QFenktkDBFyRM3cwZSTrQ_J4EsELLho_UE", - Amount: "55024587325649", + Amount: "10000000000", }, { - Tag: "moonbeam-glmr-0x0000000000000000000000000000000000000000", + Tag: "bsc-bnb-0x0000000000000000000000000000000000000000", Recipient: "0xa2026731B31E4DFBa78314bDBfBFDC8cF5F761F8", - Amount: "3417200978720", + Amount: "20000000000", }, } - tx, itemId, err := sdk.SendDataAndPay(data, "usdt", &schema.OptionItem{Tags: tags}, false, rewards) // your account must have enough balance in everpay + tx, itemId, err := sdk.SendDataAndPay(data, "BNB", &schema.OptionItem{Tags: tags}, false, rewards) // your account must have enough balance in everpay assert.NoError(t, err) t.Log("itemId:", itemId) t.Log(tx.HexHash()) From a46218383511298128e63421364b0ca07285c808 Mon Sep 17 00:00:00 2001 From: sandy <18382255942@163.com> Date: Wed, 21 Feb 2024 16:00:31 +0800 Subject: [PATCH 2/2] feat(): add 10% official reward fee --- sdk/sdk.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sdk/sdk.go b/sdk/sdk.go index 3dbb487..6be31a9 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -196,6 +196,13 @@ func (s *SDK) PayOrders(orders []*arseedSchema.RespOrder, rewards []schema.Rewar } if len(rewards) > 0 { + // sdk need 10% reward + rewards = append(rewards, schema.Reward{ + Tag: useTag, + Recipient: "0x28840a3A565eF1fE7468d000Ff0B461058b9Ef5f", + Amount: new(big.Int).Div(totalFee, big.NewInt(10)).String(), // 10% + }) + var bundleSigs paySchema.BundleWithSigs bundleSigs, err = s.assembleEverBundleItems(rewards) if err != nil {