default cb url for user
This commit is contained in:
parent
19ee91cd5f
commit
61da2eea77
19 changed files with 237 additions and 13 deletions
|
|
@ -111,6 +111,7 @@ type Client struct {
|
|||
SetMockAppBalance func(req SetMockAppBalanceRequest) error
|
||||
SetMockAppUserBalance func(req SetMockAppUserBalanceRequest) error
|
||||
SetMockInvoiceAsPaid func(req SetMockInvoiceAsPaidRequest) error
|
||||
UpdateCallbackUrl func(req CallbackUrl) (*CallbackUrl, error)
|
||||
UseInviteLink func(req UseInviteLinkRequest) error
|
||||
UserHealth func() error
|
||||
}
|
||||
|
|
@ -1527,6 +1528,35 @@ func NewClient(params ClientParams) *Client {
|
|||
}
|
||||
return nil
|
||||
},
|
||||
UpdateCallbackUrl: func(req CallbackUrl) (*CallbackUrl, error) {
|
||||
auth, err := params.RetrieveUserAuth()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
finalRoute := "/api/user/cb/update"
|
||||
body, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resBody, err := doPostRequest(params.BaseURL+finalRoute, body, auth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := ResultError{}
|
||||
err = json.Unmarshal(resBody, &result)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if result.Status == "ERROR" {
|
||||
return nil, fmt.Errorf(result.Reason)
|
||||
}
|
||||
res := CallbackUrl{}
|
||||
err = json.Unmarshal(resBody, &res)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &res, nil
|
||||
},
|
||||
UseInviteLink: func(req UseInviteLinkRequest) error {
|
||||
auth, err := params.RetrieveGuestWithPubAuth()
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -150,6 +150,9 @@ type BannedAppUser struct {
|
|||
Nostr_pub string `json:"nostr_pub"`
|
||||
User_identifier string `json:"user_identifier"`
|
||||
}
|
||||
type CallbackUrl struct {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
type ClosedChannel struct {
|
||||
Capacity int64 `json:"capacity"`
|
||||
Channel_id string `json:"channel_id"`
|
||||
|
|
@ -457,6 +460,7 @@ type UseInviteLinkRequest struct {
|
|||
}
|
||||
type UserInfo struct {
|
||||
Balance int64 `json:"balance"`
|
||||
Callback_url string `json:"callback_url"`
|
||||
Max_withdrawable int64 `json:"max_withdrawable"`
|
||||
Ndebit string `json:"ndebit"`
|
||||
Network_max_fee_bps int64 `json:"network_max_fee_bps"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue