moltspay 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -224,25 +224,24 @@ Standard templates for natural A2A dialogue:
|
|
|
224
224
|
import { SellerTemplates, BuyerTemplates, parseStatusMarker } from 'moltspay';
|
|
225
225
|
|
|
226
226
|
// Seller templates
|
|
227
|
-
SellerTemplates.askPaymentCapability()
|
|
228
|
-
SellerTemplates.guideInstall()
|
|
229
|
-
SellerTemplates.guideFunding()
|
|
230
|
-
SellerTemplates.guidePermit(agentAddr, 10) // "请向 Boss 发送..."
|
|
227
|
+
SellerTemplates.askPaymentCapability() // "Do you have USDC payment capability?"
|
|
228
|
+
SellerTemplates.guideInstall() // "Install moltspay and init wallet..."
|
|
229
|
+
SellerTemplates.guideFunding(agentAddr, 10) // "Ask Owner to send USDC to your wallet"
|
|
231
230
|
SellerTemplates.quote({ service, price, recipientAddress })
|
|
232
231
|
SellerTemplates.verificationPassed(amount)
|
|
233
232
|
SellerTemplates.deliver({ downloadUrl, fileHash })
|
|
234
233
|
SellerTemplates.receipt(receipt)
|
|
235
234
|
|
|
236
235
|
// Buyer templates
|
|
237
|
-
BuyerTemplates.requestService('
|
|
238
|
-
BuyerTemplates.noCapability()
|
|
239
|
-
BuyerTemplates.walletCreated(address)
|
|
240
|
-
BuyerTemplates.
|
|
241
|
-
BuyerTemplates.
|
|
242
|
-
BuyerTemplates.paymentSent(txHash, amount)
|
|
236
|
+
BuyerTemplates.requestService('video generation')
|
|
237
|
+
BuyerTemplates.noCapability() // "I don't have a wallet"
|
|
238
|
+
BuyerTemplates.walletCreated(address) // "[status:wallet_ready]"
|
|
239
|
+
BuyerTemplates.fundingReceived(10) // "[status:funded USDC=10]"
|
|
240
|
+
BuyerTemplates.requestFunding(addr, 10) // "Owner, please send USDC to my wallet"
|
|
241
|
+
BuyerTemplates.paymentSent(txHash, amount) // "[status:payment_sent tx=...]"
|
|
243
242
|
|
|
244
243
|
// Parse status markers from messages
|
|
245
|
-
const status = parseStatusMarker('[
|
|
244
|
+
const status = parseStatusMarker('[status:payment_sent tx=0xabc amount=3.99 USDC]');
|
|
246
245
|
// { type: 'payment_sent', data: { txHash: '0xabc', amount: '3.99' } }
|
|
247
246
|
```
|
|
248
247
|
|