forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeScript SDK] Implement execute move call (MystenLabs#2353)
- Loading branch information
Showing
7 changed files
with
204 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import type { TransactionResponse, RawSigner } from '@mysten/sui.js'; | ||
|
||
// TODO: Remove this after internal dogfooding | ||
export class ExampleNFT { | ||
/** | ||
* Mint a Example NFT. The wallet address must own enough gas tokens to pay for the transaction. | ||
* | ||
* @param signer A signer with connection to the gateway:e.g., new RawSigner(keypair, new JsonRpcProvider(endpoint)) | ||
*/ | ||
public static async mintExampleNFT( | ||
signer: RawSigner, | ||
name?: string, | ||
description?: string, | ||
imageUrl?: string | ||
): Promise<TransactionResponse> { | ||
return await signer.executeMoveCall({ | ||
packageObjectId: '0x2', | ||
module: 'DevNetNFT', | ||
function: 'mint', | ||
typeArguments: [], | ||
arguments: [ | ||
name || 'Example NFT', | ||
description || 'An NFT created by Sui Wallet', | ||
imageUrl || | ||
'ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty', | ||
], | ||
gasBudget: 10000, | ||
}); | ||
} | ||
} |