Skip to content

Commit 098f09f

Browse files
authored
Merge pull request #1220 from GeorgeTsagk/fix-fundchannel-rest
tchrpc: change FundChannel endpoint to POST
2 parents 7513141 + ff79a16 commit 098f09f

File tree

3 files changed

+49
-52
lines changed

3 files changed

+49
-52
lines changed

taprpc/tapchannelrpc/tapchannel.pb.gw.go

Lines changed: 10 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

taprpc/tapchannelrpc/tapchannel.swagger.json

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"/v1/taproot-assets/channels/fund": {
53-
"get": {
53+
"post": {
5454
"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.",
5555
"operationId": "TaprootAssetChannels_FundChannel",
5656
"responses": {
@@ -69,44 +69,12 @@
6969
},
7070
"parameters": [
7171
{
72-
"name": "asset_amount",
73-
"description": "The asset amount to fund the channel with. The BTC amount is fixed and\ncannot be customized (for now).",
74-
"in": "query",
75-
"required": false,
76-
"type": "string",
77-
"format": "uint64"
78-
},
79-
{
80-
"name": "asset_id",
81-
"description": "The asset ID to use for the channel funding.",
82-
"in": "query",
83-
"required": false,
84-
"type": "string",
85-
"format": "byte"
86-
},
87-
{
88-
"name": "peer_pubkey",
89-
"description": "The public key of the peer to open the channel with. Must already be\nconnected to this peer.",
90-
"in": "query",
91-
"required": false,
92-
"type": "string",
93-
"format": "byte"
94-
},
95-
{
96-
"name": "fee_rate_sat_per_vbyte",
97-
"description": "The channel funding fee rate in sat/vByte.",
98-
"in": "query",
99-
"required": false,
100-
"type": "integer",
101-
"format": "int64"
102-
},
103-
{
104-
"name": "push_sat",
105-
"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).",
106-
"in": "query",
107-
"required": false,
108-
"type": "string",
109-
"format": "int64"
72+
"name": "body",
73+
"in": "body",
74+
"required": true,
75+
"schema": {
76+
"$ref": "#/definitions/tapchannelrpcFundChannelRequest"
77+
}
11078
}
11179
],
11280
"tags": [
@@ -1395,6 +1363,36 @@
13951363
}
13961364
}
13971365
},
1366+
"tapchannelrpcFundChannelRequest": {
1367+
"type": "object",
1368+
"properties": {
1369+
"asset_amount": {
1370+
"type": "string",
1371+
"format": "uint64",
1372+
"description": "The asset amount to fund the channel with. The BTC amount is fixed and\ncannot be customized (for now)."
1373+
},
1374+
"asset_id": {
1375+
"type": "string",
1376+
"format": "byte",
1377+
"description": "The asset ID to use for the channel funding."
1378+
},
1379+
"peer_pubkey": {
1380+
"type": "string",
1381+
"format": "byte",
1382+
"description": "The public key of the peer to open the channel with. Must already be\nconnected to this peer."
1383+
},
1384+
"fee_rate_sat_per_vbyte": {
1385+
"type": "integer",
1386+
"format": "int64",
1387+
"description": "The channel funding fee rate in sat/vByte."
1388+
},
1389+
"push_sat": {
1390+
"type": "string",
1391+
"format": "int64",
1392+
"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)."
1393+
}
1394+
}
1395+
},
13981396
"tapchannelrpcFundChannelResponse": {
13991397
"type": "object",
14001398
"properties": {

taprpc/tapchannelrpc/tapchannel.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ config_version: 3
44
http:
55
rules:
66
- selector: tapchannelrpc.TaprootAssetChannels.FundChannel
7-
get: "/v1/taproot-assets/channels/fund"
7+
post: "/v1/taproot-assets/channels/fund"
8+
body: "*"
89
- selector: tapchannelrpc.TaprootAssetChannels.EncodeCustomRecords
910
post: "/v1/taproot-assets/channels/encode-custom-data"
1011
body: "*"

0 commit comments

Comments
 (0)