Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequences = [1, 2]
pagination = PaginationOption(skip=2, limit=4)

acknowledgements = await client.fetch_ibc_packet_acknowledgements(
port_id=port_id,
channel_id=channel_id,
packet_commitment_sequences=sequences,
pagination=pagination,
)
print(acknowledgements)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/11_UnreceivedPackets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequences = [1, 2]

packets = await client.fetch_ibc_unreceived_packets(
port_id=port_id, channel_id=channel_id, packet_commitment_sequences=sequences
)
print(packets)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/12_UnreceivedAcks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

acks = await client.fetch_ibc_unreceived_acks(
port_id=port_id,
channel_id=channel_id,
)
print(acks)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/13_NextSequenceReceive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

sequence = await client.fetch_next_sequence_receive(
port_id=port_id,
channel_id=channel_id,
)
print(sequence)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
22 changes: 22 additions & 0 deletions examples/chain_client/ibc/channel/query/1_Channel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

channel = await client.fetch_ibc_channel(port_id=port_id, channel_id=channel_id)
print(channel)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
22 changes: 22 additions & 0 deletions examples/chain_client/ibc/channel/query/2_Channels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

pagination = PaginationOption(skip=2, limit=4)

channels = await client.fetch_ibc_channels(pagination=pagination)
print(channels)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
23 changes: 23 additions & 0 deletions examples/chain_client/ibc/channel/query/3_ConnectionChannels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

connection = "connection-182"
pagination = PaginationOption(skip=2, limit=4)

channels = await client.fetch_ibc_connection_channels(connection=connection, pagination=pagination)
print(channels)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
22 changes: 22 additions & 0 deletions examples/chain_client/ibc/channel/query/4_ChannelClientState.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

state = await client.fetch_ibc_channel_client_state(port_id=port_id, channel_id=channel_id)
print(state)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
26 changes: 26 additions & 0 deletions examples/chain_client/ibc/channel/query/5_ChannelConsensusState.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
revision_number = 1
revision_height = 7990906

state = await client.fetch_ibc_channel_consensus_state(
port_id=port_id, channel_id=channel_id, revision_number=revision_number, revision_height=revision_height
)
print(state)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
23 changes: 23 additions & 0 deletions examples/chain_client/ibc/channel/query/6_PacketCommitment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequence = 1

commitment = await client.fetch_ibc_packet_commitment(port_id=port_id, channel_id=channel_id, sequence=sequence)
print(commitment)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
28 changes: 28 additions & 0 deletions examples/chain_client/ibc/channel/query/7_PacketCommitments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
pagination = PaginationOption(skip=2, limit=4)

commitment = await client.fetch_ibc_packet_commitments(
port_id=port_id,
channel_id=channel_id,
pagination=pagination,
)
print(commitment)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
23 changes: 23 additions & 0 deletions examples/chain_client/ibc/channel/query/8_PacketReceipt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequence = 1

receipt = await client.fetch_ibc_packet_receipt(port_id=port_id, channel_id=channel_id, sequence=sequence)
print(receipt)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/9_PacketAcknowledgement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequence = 1

acknowledgement = await client.fetch_ibc_packet_acknowledgement(
port_id=port_id, channel_id=channel_id, sequence=sequence
)
print(acknowledgement)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
Loading