Skip to content

Commit

Permalink
document entire HTTP request/response
Browse files Browse the repository at this point in the history
  • Loading branch information
freddiecoleman committed Dec 17, 2024
1 parent b070708 commit 49a702e
Showing 1 changed file with 56 additions and 38 deletions.
94 changes: 56 additions & 38 deletions CHIPs/chip-0039.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,50 +115,68 @@ Fee services should:
6. Service returns complete spend bundle to client
7. Client can verify and submit the transaction

### Example Spend Bundle Modification
### HTTP Request/Response Examples

#### Request

```http
POST /api/fees HTTP/1.1
Content-Type: application/json
```
# Original spend bundle:
{
"coin_spends": [
{
"coin": {
"parent_coin_info": "0x...",
"puzzle_hash": "0x...",
"amount": 1000
},
"puzzle_reveal": "0x...",
"solution": "0x..."
}
],
"aggregated_signature": "0x..."
"network": "mainnet",
"spendBundle": {
"aggregated_signature": "0x..."
"coin_spends": [
{
"coin": {
"parent_coin_info": "0x...",
"puzzle_hash": "0x...",
"amount": 1000
},
"puzzle_reveal": "0x...",
"solution": "0x..."
}
],
},
"submit": false
}
```

#### Success Response

```http
HTTP/1.1 201 OK
Content-Type: application/json
# After fee service:
{
"coin_spends": [
# Original spend
{
"coin": {
"parent_coin_info": "0x...",
"puzzle_hash": "0x...",
"amount": 1000
},
"puzzle_reveal": "0x...",
"solution": "0x..."
},
# Added fee spend
{
"coin": {
"parent_coin_info": "0x...",
"puzzle_hash": "0x...",
"amount": 100
"spendBundle": {
"aggregated_signature": "0x...",
"coin_spends": [
# Original spend
{
"coin": {
"parent_coin_info": "0x...",
"puzzle_hash": "0x...",
"amount": 1000
},
"puzzle_reveal": "0x...",
"solution": "0x..."
},
"puzzle_reveal": "0x...",
"solution": "0x..."
}
],
"aggregated_signature": "0x..." # Updated to include fee spend
# Added fee spend
{
"coin": {
"parent_coin_info": "0x...",
"puzzle_hash": "0x...",
"amount": 100
},
"puzzle_reveal": "0x...",
"solution": "0x..."
}
],
},
"fees": 100000,
"submitted": false
}
```

Expand Down

0 comments on commit 49a702e

Please sign in to comment.