Skip to content

Commit 7feb771

Browse files
committed
add cancel uma invitation mutation to py sdk
1 parent 995c259 commit 7feb771

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

lightspark/lightspark_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
from lightspark.requests.requester import Requester
6464
from lightspark.scripts.bitcoin_fee_estimate import BITCOIN_FEE_ESTIMATE_QUERY
6565
from lightspark.scripts.cancel_invoice import CANCEL_INVOICE_MUTATION
66+
from lightspark.scripts.cancel_uma_invitation import CANCEL_UMA_INVITATION_MUTATION
6667
from lightspark.scripts.claim_uma_invitation import (
6768
CLAIM_UMA_INVITATION_MUTATION,
6869
CLAIM_UMA_INVITATION_WITH_INCENTIVES_MUTATION,
@@ -1049,5 +1050,23 @@ def create_uma_invitation_with_payment(
10491050
self._requester, json["create_uma_invitation_with_payment"]["invitation"]
10501051
)
10511052

1053+
def cancel_uma_invitation(
1054+
self,
1055+
invite_code: str,
1056+
) -> UmaInvitation:
1057+
"""
1058+
Cancels a UMA invitation.
1059+
1060+
Args:
1061+
invite_code: The invitation code to cancel.
1062+
"""
1063+
json = self._requester.execute_graphql(
1064+
CANCEL_UMA_INVITATION_MUTATION,
1065+
{"invite_code": invite_code},
1066+
)
1067+
return UmaInvitation_from_json(
1068+
self._requester, json["cancel_uma_invitation"]["invitation"]
1069+
)
1070+
10521071

10531072
E614_REGEX = re.compile(r"^\+?[1-9]\d{1,14}$")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright ©, 2022-present, Lightspark Group, Inc. - All Rights Reserved
2+
3+
from lightspark.objects.UmaInvitation import FRAGMENT as INVITATION_FRAGMENT
4+
5+
CANCEL_UMA_INVITATION_MUTATION = f"""
6+
mutation CancelUmaInvitation(
7+
$invite_code: String!
8+
) {{
9+
cancel_uma_invitation(input: {{
10+
invite_code: $invite_code
11+
}}) {{
12+
invitation {{
13+
...UmaInvitationFragment
14+
}}
15+
}}
16+
}}
17+
18+
{INVITATION_FRAGMENT}
19+
"""

0 commit comments

Comments
 (0)