dogecoinfoundation / gigawallet

GigaWallet is the backend for your Dogecoin Business.
https://gigawallet.dogecoin.org
MIT License
56 stars 11 forks source link

Multiple payout targets #113

Open tjstebbing opened 1 year ago

tjstebbing commented 1 year ago

Being able to payout in a single transaction to multiple addresses enables the 'fee for processing' usecase where a provider of GigaWallet (as a payment service) wants n% or a fixed amount of doge to go to their own address on payout.

Suggestion:

was:

POST /account/:foreignID/pay { "amount": "1.0", "to": "DPeTgZm7LabnmFTJkAPfADkwiKreEMmzio" } -> { status }

POST /account/:foreignID/pay { "DPeTgZm7LabnmFTJkAPfADkwiKreEMmzio" : "1.0", ... } -> { status }

How does fee work for payout?

raffecat commented 1 year ago

I think the payments should be in a field, like:

{ "pay": { "DPeTgZm7LabnmFTJkAPfADkwiKreEMmzio" : "1.0", ... } }

So then we can extend the arguments like:

{ "deduct_fee": true, "pay": { "DPeTgZm7LabnmFTJkAPfADkwiKreEMmzio" : "1.0", ... } }
tjstebbing commented 1 year ago
{ 
  "explicit_fee" :  "0.02" // optional
  "pay":  [
   { 
     "to": "DPeTgZm7LabnmFTJkAPfADkwiKreEMmzio",
     "amount" : "1.0",
     "deduct_fee_percent" :  "100", // optional
   },
   { 
     "to": "kAPfADkwiKreEMmzioDPeTgZm7LabnmFTJ",
     "amount" : "100.0",
   },

   ],

} 
raffecat commented 1 year ago

deduct_fee_percent?

georgeartem commented 1 year ago

Personally I like the idea of being able to do both explicit fee and percentage allowing the implementer to choose.