Skip to content

Commit

Permalink
Add sample data for transferSui (MystenLabs#3550)
Browse files Browse the repository at this point in the history
  • Loading branch information
666lcz authored Jul 27, 2022
1 parent 78a7fb9 commit 6d95e50
Show file tree
Hide file tree
Showing 4 changed files with 766 additions and 621 deletions.
46 changes: 23 additions & 23 deletions crates/sui-open-rpc/samples/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
"fields": {
"description": "An NFT created by the Sui Command Line Tool",
"info": {
"id": "0x9fd6bb96976b53056bd3d9237969d2f2df59655f",
"id": "0x854fe785af73a11143a8fb77ed2f27375be2fc4b",
"version": 1
},
"name": "Example NFT",
"url": "ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty"
}
},
"owner": {
"AddressOwner": "0x4031b14908c392c088c6baa552ef65763380faac"
"AddressOwner": "0x89bcfb0ce968fa17f233855d4864ed0b3dfe84d8"
},
"previousTransaction": "8UXdeGfgdctlZHP3BesbiFd+4AmhsZ6DiibEIV18yJs=",
"previousTransaction": "jbhiCvnUouH3gT/xyOleikiEandTaqCHTVhwzjx6k5k=",
"storageRebate": 25,
"reference": {
"objectId": "0x9fd6bb96976b53056bd3d9237969d2f2df59655f",
"objectId": "0x854fe785af73a11143a8fb77ed2f27375be2fc4b",
"version": 1,
"digest": "yFKz/aNLo12vJbf8gUHRhf7heMV/v40/Zlag9AKa5N4="
"digest": "Sgo65Uq8vPwArvG0u68p+vfGMIlAT2sI8omqAggvliI="
}
}
},
Expand All @@ -38,20 +38,20 @@
"fields": {
"balance": 100000000,
"info": {
"id": "0x0d1166cdf2512f0b7e52e30d7c22259aaf3207f2",
"id": "0x076df594e9929aa038d3bb2f210ac92d3c1113de",
"version": 0
}
}
},
"owner": {
"AddressOwner": "0x4031b14908c392c088c6baa552ef65763380faac"
"AddressOwner": "0x89bcfb0ce968fa17f233855d4864ed0b3dfe84d8"
},
"previousTransaction": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"storageRebate": 0,
"reference": {
"objectId": "0x0d1166cdf2512f0b7e52e30d7c22259aaf3207f2",
"objectId": "0x076df594e9929aa038d3bb2f210ac92d3c1113de",
"version": 0,
"digest": "Oj4orsKw606PfnfCh+etACVdbxZlvi2ltnqzXQDxfRc="
"digest": "FSHJhC5XAgLQcCIjn2mAtcHs/Q6C6wfahS6EXOIfw8c="
}
}
},
Expand All @@ -61,16 +61,16 @@
"data": {
"dataType": "package",
"disassembled": {
"m1": "// Move bytecode v5\nmodule a1e55a1a53bdb80d1d97368a4fcd1516e1cb74c4.m1 {\nstruct Forge has store, key {\n\tinfo: Info,\n\tswords_created: u64\n}\nstruct Sword has store, key {\n\tinfo: Info,\n\tmagic: u64,\n\tstrength: u64\n}\n\ninit(Arg0: &mut TxContext) {\nB0:\n\t0: CopyLoc[0](Arg0: &mut TxContext)\n\t1: Call[6](new(&mut TxContext): Info)\n\t2: LdU64(0)\n\t3: Pack[0](Forge)\n\t4: StLoc[1](loc0: Forge)\n\t5: MoveLoc[1](loc0: Forge)\n\t6: MoveLoc[0](Arg0: &mut TxContext)\n\t7: FreezeRef\n\t8: Call[7](sender(&TxContext): address)\n\t9: Call[0](transfer<Forge>(Forge, address))\n\t10: Ret\n}\npublic magic(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[0](Sword.magic: u64)\n\t2: ReadRef\n\t3: Ret\n}\npublic strength(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[1](Sword.strength: u64)\n\t2: ReadRef\n\t3: Ret\n}\nentry public sword_create(Arg0: &mut Forge, Arg1: u64, Arg2: u64, Arg3: address, Arg4: &mut TxContext) {\nB0:\n\t0: MoveLoc[4](Arg4: &mut TxContext)\n\t1: Call[6](new(&mut TxContext): Info)\n\t2: MoveLoc[1](Arg1: u64)\n\t3: MoveLoc[2](Arg2: u64)\n\t4: Pack[1](Sword)\n\t5: StLoc[5](loc0: Sword)\n\t6: MoveLoc[5](loc0: Sword)\n\t7: MoveLoc[3](Arg3: address)\n\t8: Call[1](transfer<Sword>(Sword, address))\n\t9: CopyLoc[0](Arg0: &mut Forge)\n\t10: ImmBorrowField[2](Forge.swords_created: u64)\n\t11: ReadRef\n\t12: LdU64(1)\n\t13: Add\n\t14: MoveLoc[0](Arg0: &mut Forge)\n\t15: MutBorrowField[2](Forge.swords_created: u64)\n\t16: WriteRef\n\t17: Ret\n}\nentry public sword_transfer(Arg0: Sword, Arg1: address) {\nB0:\n\t0: MoveLoc[0](Arg0: Sword)\n\t1: MoveLoc[1](Arg1: address)\n\t2: Call[1](transfer<Sword>(Sword, address))\n\t3: Ret\n}\npublic swords_created(Arg0: &Forge): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Forge)\n\t1: ImmBorrowField[2](Forge.swords_created: u64)\n\t2: ReadRef\n\t3: Ret\n}\n}"
"m1": "// Move bytecode v5\nmodule d1f083132db934d33b9cfdb6a94d4790d62e2e18.m1 {\nstruct Forge has store, key {\n\tinfo: Info,\n\tswords_created: u64\n}\nstruct Sword has store, key {\n\tinfo: Info,\n\tmagic: u64,\n\tstrength: u64\n}\n\ninit(Arg0: &mut TxContext) {\nB0:\n\t0: CopyLoc[0](Arg0: &mut TxContext)\n\t1: Call[6](new(&mut TxContext): Info)\n\t2: LdU64(0)\n\t3: Pack[0](Forge)\n\t4: StLoc[1](loc0: Forge)\n\t5: MoveLoc[1](loc0: Forge)\n\t6: MoveLoc[0](Arg0: &mut TxContext)\n\t7: FreezeRef\n\t8: Call[7](sender(&TxContext): address)\n\t9: Call[0](transfer<Forge>(Forge, address))\n\t10: Ret\n}\npublic magic(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[0](Sword.magic: u64)\n\t2: ReadRef\n\t3: Ret\n}\npublic strength(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[1](Sword.strength: u64)\n\t2: ReadRef\n\t3: Ret\n}\nentry public sword_create(Arg0: &mut Forge, Arg1: u64, Arg2: u64, Arg3: address, Arg4: &mut TxContext) {\nB0:\n\t0: MoveLoc[4](Arg4: &mut TxContext)\n\t1: Call[6](new(&mut TxContext): Info)\n\t2: MoveLoc[1](Arg1: u64)\n\t3: MoveLoc[2](Arg2: u64)\n\t4: Pack[1](Sword)\n\t5: StLoc[5](loc0: Sword)\n\t6: MoveLoc[5](loc0: Sword)\n\t7: MoveLoc[3](Arg3: address)\n\t8: Call[1](transfer<Sword>(Sword, address))\n\t9: CopyLoc[0](Arg0: &mut Forge)\n\t10: ImmBorrowField[2](Forge.swords_created: u64)\n\t11: ReadRef\n\t12: LdU64(1)\n\t13: Add\n\t14: MoveLoc[0](Arg0: &mut Forge)\n\t15: MutBorrowField[2](Forge.swords_created: u64)\n\t16: WriteRef\n\t17: Ret\n}\nentry public sword_transfer(Arg0: Sword, Arg1: address) {\nB0:\n\t0: MoveLoc[0](Arg0: Sword)\n\t1: MoveLoc[1](Arg1: address)\n\t2: Call[1](transfer<Sword>(Sword, address))\n\t3: Ret\n}\npublic swords_created(Arg0: &Forge): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Forge)\n\t1: ImmBorrowField[2](Forge.swords_created: u64)\n\t2: ReadRef\n\t3: Ret\n}\n}"
}
},
"owner": "Immutable",
"previousTransaction": "DNUZMlppywaEvoowWg3OwQCSTLdJ4iac3IHFGd5WPbU=",
"previousTransaction": "aY6+gdaj6WmxrQibQnCNC0YpWKzmMXGyHa5JjN+D+I0=",
"storageRebate": 0,
"reference": {
"objectId": "0xa1e55a1a53bdb80d1d97368a4fcd1516e1cb74c4",
"objectId": "0xd1f083132db934d33b9cfdb6a94d4790d62e2e18",
"version": 1,
"digest": "Z8fyIve3cRUMupOzac0Mw2Y9aE6ur2Nhr6rLKD/BpwY="
"digest": "bCwzFx9TEJsjXmHH2qrRDafbBN0Gt3//Jybl8Sl3/kU="
}
}
},
Expand All @@ -79,22 +79,22 @@
"details": {
"data": {
"dataType": "moveObject",
"type": "0x730fdff980e28fb843ded3d7aac9d41c1859e0ff::hero::Hero",
"type": "0x205baac11264648ec9938472b19c80a61d92ea68::hero::Hero",
"has_public_transfer": true,
"fields": {
"experience": 0,
"game_id": "0x15d51be2d119fb1f6454ba877ea1242ede7494d1",
"game_id": "0x634b6a680d4c92e85732eb14d927fc8d20305d9d",
"hp": 100,
"info": {
"id": "0x4bd84ee1997376ae3286db96dfb102bea40423a7",
"id": "0x7896b7ed80eb9ad6b6abd874244d292aa718c4c8",
"version": 1
},
"sword": {
"type": "0x730fdff980e28fb843ded3d7aac9d41c1859e0ff::hero::Sword",
"type": "0x205baac11264648ec9938472b19c80a61d92ea68::hero::Sword",
"fields": {
"game_id": "0x15d51be2d119fb1f6454ba877ea1242ede7494d1",
"game_id": "0x634b6a680d4c92e85732eb14d927fc8d20305d9d",
"info": {
"id": "0x6a2c70e3865c1c775b9bc490a6c82370f4014134",
"id": "0x5dd27938d9adf046d746c21fccc8ff99c6b94962",
"version": 0
},
"magic": 10,
Expand All @@ -104,14 +104,14 @@
}
},
"owner": {
"AddressOwner": "0x4031b14908c392c088c6baa552ef65763380faac"
"AddressOwner": "0x89bcfb0ce968fa17f233855d4864ed0b3dfe84d8"
},
"previousTransaction": "Fpf9k8HNsb6HydNTfH3GK7GFH1bCrn1AnK6TcNP/4sg=",
"previousTransaction": "mRBGhxBwYTQYQspbU/f/SDKwpJdOs+qO62//iMyWuvE=",
"storageRebate": 22,
"reference": {
"objectId": "0x4bd84ee1997376ae3286db96dfb102bea40423a7",
"objectId": "0x7896b7ed80eb9ad6b6abd874244d292aa718c4c8",
"version": 1,
"digest": "C/9gzDFPcTp3g5gPhOlbanP1NwZNZtqnPhXs0H9nsYQ="
"digest": "aOnnE7aqOpkADUaKuIE+KBcGjQmM5ysTAMI7WKr1akk="
}
}
}
Expand Down
Loading

0 comments on commit 6d95e50

Please sign in to comment.