This module allows two people to do an escrow transaction. The offeror will start the escrow process by offering a coin and then defining the expected coin amount. Eventually, the taker of the offer will be sent exactly the same number of expected coins and then the offered coin will be given to the taker of the offer.
Make sure you have installed all the required tools that mentioned here https://docs.sui.io/devnet/build.
- Go to the
escrow
directory and then runsui move test
to test the code. - To build the binary files, we can run
sui move build
. After the build success - To publish the current package please run
sui client publish --gas-budget 1000
. After it published you can see in your terminal there's a Transaction Effects section that telling the object ID of the Created Objects. That object ID will be the package address. So make sure you keep it somewhere. - And then open
main.ts
in theclient/ts/src
directory. Change theMODULE_OBJECT_ID
to your published package address. - And then run
npm start
on theclient/ts
directory. You will see Alice address and Bob address in your terminal. You need to fund this address before able to run the scripts successfully (here's how to get SUI tokens on Devnet https://docs.sui.io/devnet/build/install#sui-tokens). And then run thenpm start
once again. That's it!