-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Refactored transactions. Removed redundant hooks in favor o…
…f useTransact(). Added getResponseObjectId() function.
- Loading branch information
Showing
8 changed files
with
108 additions
and
127 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,41 @@ | ||
import { fullFunctionName } from '@/helpers/greeting/misc' | ||
import { TransactionBlock } from '@mysten/sui.js/transactions' | ||
|
||
export const prepareCreateGreetingTransaction = ( | ||
packageId: string | ||
): TransactionBlock => { | ||
const txb = new TransactionBlock() | ||
txb.moveCall({ | ||
arguments: [], | ||
target: fullFunctionName(packageId, 'create'), | ||
}) | ||
|
||
return txb | ||
} | ||
|
||
export const prepareSetGreetingTransaction = ( | ||
packageId: string, | ||
objectId: string, | ||
name: string | ||
): TransactionBlock => { | ||
const txb = new TransactionBlock() | ||
txb.moveCall({ | ||
arguments: [txb.object(objectId), txb.pure.string(name), txb.object('0x8')], | ||
target: fullFunctionName(packageId, 'set_greeting'), | ||
}) | ||
|
||
return txb | ||
} | ||
|
||
export const prepareResetGreetingTransaction = ( | ||
packageId: string, | ||
objectId: string | ||
): TransactionBlock => { | ||
const txb = new TransactionBlock() | ||
txb.moveCall({ | ||
arguments: [txb.object(objectId)], | ||
target: fullFunctionName(packageId, 'reset_greeting'), | ||
}) | ||
|
||
return txb | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 was deleted.
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