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
""" | |
pip install stellar-sdk==9.0.0b0 | |
""" | |
import time | |
from stellar_sdk import ( | |
InvokeHostFunction, | |
Keypair, | |
Network, | |
SorobanServer, |
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
import requests | |
from stellar_sdk import Server | |
from stellar_sdk.client.requests_client import RequestsClient | |
session = requests.Session() | |
session.proxies = { | |
'https': 'http://your_proxy_ip:port', | |
} |
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
import time | |
from stellar_sdk import Network, Keypair, TransactionBuilder | |
from stellar_sdk import xdr as stellar_xdr | |
from stellar_sdk.soroban import AuthorizedInvocation, ContractAuth, SorobanServer | |
from stellar_sdk.soroban.soroban_rpc import GetTransactionStatus | |
from stellar_sdk.soroban.types import Address, Bytes, Int128 | |
rpc_server_url = "https://rpc-futurenet.stellar.org:443/" | |
soroban_server = SorobanServer(rpc_server_url) |
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
import time | |
from stellar_sdk import ( | |
Network, | |
Keypair, | |
TransactionBuilder, | |
) | |
from stellar_sdk import xdr as stellar_xdr | |
from stellar_sdk.soroban import SorobanServer, ContractAuth, AuthorizedInvocation | |
from stellar_sdk.soroban.soroban_rpc import GetTransactionStatus |
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
""" | |
pip install git+https://github.com/StellarCN/py-stellar-base.git@soroban | |
""" | |
import binascii | |
from stellar_sdk import xdr as stellar_xdr | |
from stellar_sdk.soroban import SorobanServer | |
from stellar_sdk.soroban.exceptions import RequestException | |
rpc_server_url = "https://horizon-futurenet.stellar.cash:443/soroban/rpc" |
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
""" | |
pip install git+https://github.com/StellarCN/py-stellar-base.git@soroban-auth-next | |
""" | |
import time | |
from stellar_sdk import Network, Keypair, TransactionBuilder | |
from stellar_sdk import xdr as stellar_xdr | |
from stellar_sdk.authorized_invocation import AuthorizedInvocation | |
from stellar_sdk.contract_auth import ContractAuth | |
from stellar_sdk.soroban import SorobanServer |
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
from stellar_sdk import Asset, Network, Address, utils | |
from stellar_sdk import xdr as stellar_xdr | |
def get_asset_contract_id(asset: Asset, network_passphrase: str) -> str: | |
"""Get the contract id of the wrapped token contract.""" | |
network_id_hash = stellar_xdr.Hash(Network(network_passphrase).network_id()) | |
data = stellar_xdr.HashIDPreimage( | |
stellar_xdr.EnvelopeType.ENVELOPE_TYPE_CONTRACT_ID, | |
contract_id=stellar_xdr.HashIDPreimageContractID( |
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
""" | |
Install Stellar Python SDK from soroban branch: | |
pip install git+https://github.com/StellarCN/py-stellar-base.git@soroban | |
""" | |
import time | |
from stellar_sdk import Network, Keypair, TransactionBuilder | |
from stellar_sdk import xdr as stellar_xdr | |
from stellar_sdk.soroban import SorobanServer | |
from stellar_sdk.soroban.soroban_rpc import TransactionStatus |
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
import time | |
from stellar_sdk import Network, Keypair, TransactionBuilder | |
from stellar_sdk import xdr as stellar_xdr | |
from stellar_sdk.soroban import SorobanServer | |
from stellar_sdk.soroban.soroban_rpc import TransactionStatus | |
from stellar_sdk.soroban_types import AccountIdentifier, InvokerSignature, Int64 | |
secret = "SAAPYAPTTRZMCUZFPG3G66V4ZMHTK4TWA6NS7U4F7Z3IMUD52EK4DDEV" | |
rpc_server_url = "https://horizon-futurenet.stellar.cash/soroban/rpc" |
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
from decimal import Decimal | |
from typing import List, Any, Dict | |
from stellar_sdk import * | |
server = Server("https://horizon-testnet.stellar.org") | |
# Preamble | |
def new_tx_builder(source: str) -> TransactionBuilder: |
NewerOlder