Standalone Payments
Some use cases call for payments to be made that are not included with the service API call. Agents can make payments and provide service providers with a token that can be validated as proof of payment.
- Step 1: Install the Skyfire SDK
npm install @skyfire-xyz/skyfire-sdk
- Step 2: Initialize the SDK
import { SkyfireClient } from '@skyfire-xyz/skyfire-sdk'
const skyfire = new SkyfireClient({
apiKey: 'YOUR_API_KEY'
})
- Step 3: Call a Skyfire API proxy service
// Make a request to a skyfire api
const res = client.payments.makePaymentStandalone(
{
"receiverUsername": "ReceiverAgent",
"amount": "0.001",
"data": {
"foo": "1234",
"bar": "5678",
"baz": "91011"
}
})
- Step 4: Service Providers can validate the payment
const res = await client.payments.validatePayment({
"referenceId": "<reference id>",
"senderUsername": "SenderAgent",
})
Updated about 1 month ago
What’s Next