商戶支付與積分
常用儲存查詢
Section titled “常用儲存查詢”| 儲存 | 回傳值 |
|---|---|
D9Merchant::Accounts(account) |
積分餘額、係數與贖回紀錄 |
D9Merchant::MerchantExpiry(account) |
商戶訂閱到期時間(Unix 毫秒時間戳記) |
D9Merchant::GovernedSubscriptionFee |
每 30 天週期的訂閱費用(USDT) |
Assets::Account(2, merchant) |
商戶 Energy(能量)餘額 |
Assets::Account(3, merchant) |
商戶 Bandwidth(頻寬)餘額 |
1. 支付商戶帳單
Section titled “1. 支付商戶帳單”D9Merchant::send_payment(merchant, usdt_amount, funding, min_pool_d9_out)| 參數 | 說明 |
|---|---|
merchant |
處於有效期內的商戶帳戶 |
usdt_amount |
帳單總額(USDT 最小單位,6 位小數) |
funding |
PaymentFunding::Usdt 直接使用顧客 USDT 支付;或 PaymentFunding::D9 { max_d9_in } 透過 AMM 將顧客 D9 兌換為 USDT,最多支出 max_d9_in |
min_pool_d9_out |
16% 獎勵池部分兌換為 D9 時的滑點下限 |
發起支付前,請先確認 MerchantExpiry(merchant) 尚未到期,且商戶持有足夠的 Energy 與 Bandwidth。
交易最終確認後,資金依以下規則結算:
- 84% 以 USDT 結算給商戶。
- 16% 經 AMM 兌換為 D9 並注入燃燒挖礦獎勵池。
- 顧客帳戶於
D9Merchant::Accounts獲得對應積分。
2. 商戶訂閱與續費
Section titled “2. 商戶訂閱與續費”D9Merchant::subscribe(periods)periods:可選1、3、6或12(每個週期為 30 天)。- 訂閱累計有效期上限為自目前區塊時間起 365 天。
3. 顧客積分贖回
Section titled “3. 顧客積分贖回”D9Merchant::redeem_d9(min_d9_out)- 呼叫 Runtime API
UserPortfolioApi_get_merchant_redemption_quote取得贖回報價。 - 等待
cooldown_remaining_ms歸零(單位為毫秒)。 - 將
min_d9_out設為略低於報價中的estimated_d9並送出redeem_d9。若實際可贖回數量低於下限,呼叫會報錯RedemptionBelowMinimum且不會變更任何狀態。 - 贖回成功後發放原生 D9。
