-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
315 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .sample_payload import payload as sample_payload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python | ||
# coding: utf-8 | ||
|
||
import binascii | ||
from uuid import uuid4 | ||
|
||
payload = { | ||
'custom_meta': { | ||
'instruction': 'Hey! Please sign for:\n\nThis\nand\nthat 🍻', | ||
'blob': { | ||
'myOwnProp': 'Whereever', | ||
'clientCountry': 'Moon', | ||
}, | ||
'identifier': str(uuid4()) | ||
}, | ||
'options': { | ||
'submit': True, | ||
'multisign': False, | ||
'expire': 500, | ||
'return_url': { | ||
'app': 'https://example.com/callback?payload={id}&blob={txblob}', | ||
'web': 'https://example.com/callback?identifier={cid}&tx={txid}' | ||
} | ||
}, | ||
'txjson': { | ||
'TransactionType' : 'Payment', | ||
'Destination' : 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', | ||
'DestinationTag': 495, | ||
'Amount': '1337', | ||
'LastLedgerSequence': 20, | ||
'Fee': '12', | ||
'Memos': [ | ||
{ | ||
'Memo': { | ||
'MemoData': binascii.hexlify('Sample XUMM payload'.encode('utf8')).decode('utf-8').upper(), | ||
'MemoFormat': binascii.hexlify('some/memo'.encode('utf8')).decode('utf-8').upper(), | ||
} | ||
} | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python | ||
# coding: utf-8 | ||
import logging | ||
import asyncio | ||
|
||
import xumm | ||
|
||
class MiscExample: | ||
def __init__(self): | ||
logging.debug('') | ||
self.sdk = xumm.XummSdk('API_KEY', 'API_SECRET') | ||
self.logger = logging.getLogger(self.__module__) | ||
self.logger.setLevel(level=logging.DEBUG) | ||
|
||
async def run(self): | ||
# send ping to the backend and print application name | ||
ping_response = self.sdk.ping() | ||
self.logger.info("Ping response: application name: %s" % ping_response.application.name) | ||
|
||
# get curated assets and print available currencies count | ||
curated_assets_response = self.sdk.get_curated_assets() | ||
self.logger.info("Curated_assets response: currencies count %s" % str(len(curated_assets_response.currencies))) | ||
|
||
|
||
# get kyc status of a xrpl address | ||
address = "rDWLGshgAxSX2G4TEv3gA6QhtLgiXrWQXB" | ||
kyc_status_response = self.sdk.get_kyc_status(address) | ||
self.logger.info("Kyc status for account %s: %s" % (address, kyc_status_response)) | ||
|
||
|
||
# get transaction by hash from ledger | ||
tx_hash = "017DED8F5E20F0335C6F56E3D5EE7EF5F7E83FB81D2904072E665EEA69402567" | ||
get_tx_response = self.sdk.get_transaction(tx_hash) | ||
self.logger.info("transaction balance changes: %s" % get_tx_response.balance_changes) | ||
|
||
|
||
if __name__ == "__main__": | ||
example = MiscExample() | ||
|
||
loop = asyncio.get_event_loop() | ||
loop.run_until_complete(example.run()) | ||
|
Oops, something went wrong.