-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: UrAvgDeveloper <[email protected]>
- Loading branch information
1 parent
a3d60f7
commit 98f8df5
Showing
11 changed files
with
667 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from uagents import Agent, Bureau, Context | ||
from uagents.wallet_messaging import WalletMessage | ||
|
||
|
||
ALICE_SEED = "alice dorado recovery phrase" | ||
BOB_SEED = "bob dorado recovery phrase" | ||
|
||
alice = Agent(name="alice", seed=ALICE_SEED, enable_wallet_messaging=True) | ||
bob = Agent(name="bob", seed=BOB_SEED, enable_wallet_messaging=True) | ||
|
||
|
||
@alice.on_wallet_message() | ||
async def reply(ctx: Context, msg: WalletMessage): | ||
ctx.logger.info(f"Got wallet message: {msg.text}") | ||
await ctx.send_wallet_message(msg.sender, "hey, thanks for the message") | ||
|
||
|
||
@bob.on_interval(period=5) | ||
async def send_message(ctx: Context): | ||
ctx.logger.info("Sending message...") | ||
await ctx.send_wallet_message(alice.address, "hello") | ||
|
||
|
||
@bob.on_wallet_message() | ||
async def wallet_reply(ctx: Context, msg: WalletMessage): | ||
ctx.logger.info(f"Got wallet message: {msg.text}") | ||
|
||
|
||
bureau = Bureau() | ||
bureau.add(alice) | ||
bureau.add(bob) | ||
bureau.run() |
Large diffs are not rendered by default.
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
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 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
Oops, something went wrong.