Skip to content

Commit

Permalink
Merge pull request #1220 from GeorgeTsagk/fix-fundchannel-rest
Browse files Browse the repository at this point in the history
tchrpc: change FundChannel endpoint to POST
  • Loading branch information
GeorgeTsagk authored Nov 27, 2024
2 parents 7513141 + ff79a16 commit 098f09f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 52 deletions.
22 changes: 10 additions & 12 deletions taprpc/tapchannelrpc/tapchannel.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 37 additions & 39 deletions taprpc/tapchannelrpc/tapchannel.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
},
"/v1/taproot-assets/channels/fund": {
"get": {
"post": {
"summary": "FundChannel initiates the channel funding negotiation with a peer for the\ncreation of a channel that contains a specified amount of a given asset.",
"operationId": "TaprootAssetChannels_FundChannel",
"responses": {
Expand All @@ -69,44 +69,12 @@
},
"parameters": [
{
"name": "asset_amount",
"description": "The asset amount to fund the channel with. The BTC amount is fixed and\ncannot be customized (for now).",
"in": "query",
"required": false,
"type": "string",
"format": "uint64"
},
{
"name": "asset_id",
"description": "The asset ID to use for the channel funding.",
"in": "query",
"required": false,
"type": "string",
"format": "byte"
},
{
"name": "peer_pubkey",
"description": "The public key of the peer to open the channel with. Must already be\nconnected to this peer.",
"in": "query",
"required": false,
"type": "string",
"format": "byte"
},
{
"name": "fee_rate_sat_per_vbyte",
"description": "The channel funding fee rate in sat/vByte.",
"in": "query",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "push_sat",
"description": "The number of satoshis to give the remote side as part of the initial\ncommitment state. This is equivalent to first opening a channel and then\nsending the remote party funds, but all done in one step. Therefore, this\nis equivalent to a donation to the remote party, unless they reimburse\nthe funds in another way (outside the protocol).",
"in": "query",
"required": false,
"type": "string",
"format": "int64"
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tapchannelrpcFundChannelRequest"
}
}
],
"tags": [
Expand Down Expand Up @@ -1395,6 +1363,36 @@
}
}
},
"tapchannelrpcFundChannelRequest": {
"type": "object",
"properties": {
"asset_amount": {
"type": "string",
"format": "uint64",
"description": "The asset amount to fund the channel with. The BTC amount is fixed and\ncannot be customized (for now)."
},
"asset_id": {
"type": "string",
"format": "byte",
"description": "The asset ID to use for the channel funding."
},
"peer_pubkey": {
"type": "string",
"format": "byte",
"description": "The public key of the peer to open the channel with. Must already be\nconnected to this peer."
},
"fee_rate_sat_per_vbyte": {
"type": "integer",
"format": "int64",
"description": "The channel funding fee rate in sat/vByte."
},
"push_sat": {
"type": "string",
"format": "int64",
"description": "The number of satoshis to give the remote side as part of the initial\ncommitment state. This is equivalent to first opening a channel and then\nsending the remote party funds, but all done in one step. Therefore, this\nis equivalent to a donation to the remote party, unless they reimburse\nthe funds in another way (outside the protocol)."
}
}
},
"tapchannelrpcFundChannelResponse": {
"type": "object",
"properties": {
Expand Down
3 changes: 2 additions & 1 deletion taprpc/tapchannelrpc/tapchannel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ config_version: 3
http:
rules:
- selector: tapchannelrpc.TaprootAssetChannels.FundChannel
get: "/v1/taproot-assets/channels/fund"
post: "/v1/taproot-assets/channels/fund"
body: "*"
- selector: tapchannelrpc.TaprootAssetChannels.EncodeCustomRecords
post: "/v1/taproot-assets/channels/encode-custom-data"
body: "*"
Expand Down

0 comments on commit 098f09f

Please sign in to comment.