Skip to content

Commit

Permalink
misses
Browse files Browse the repository at this point in the history
  • Loading branch information
DaughterOfMars committed Nov 4, 2024
1 parent 2c30798 commit cd42dcf
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions docs/content/references/ts-sdk/kiosk/advanced-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const kioskClient = new KioskClient({
This example demonstrates how to mint a MyCoin.

```typescript
async function mintFren(address: string) {
async function mintMyCoin(address: string) {
const { kioskOwnerCaps } = await kioskClient.getOwnedKiosks({ address });

// Choose the first kiosk for simplicity. We could have extra logic here (e.g. let the user choose, pick a personal one, etc).
Expand Down Expand Up @@ -57,45 +57,45 @@ async function mintFren(address: string) {

## Mixing two MyCoins

This example demonstrates how to use the Kiosk SDK to mix two `bullsharks`.
This example demonstrates how to use the Kiosk SDK to mix two `MyCoins`.

```typescript
// We're mixing two frens.
async function mixFrens(firstFrenObjectId: string, secondFrenObjectId: string, cap: KioskOwnerCap) {
// We're mixing two coins.
async function mixMyCoins(firstCoinObjectId: string, secondCoinObjectId: string, cap: KioskOwnerCap) {
const txb = new TransactionBlock();
const kioskTx = new KioskTransaction({ transactionBlock: txb, kioskClient, cap });

// borrow both frens.
const [fren1, promise1] = kioskTx.borrow({
itemType: bullsharkType,
itemId: firstFrenObjectId.
// borrow both coins.
const [coin1, promise1] = kioskTx.borrow({
itemType: myType,
itemId: firstCoinObjectId.
});

const [fren2, promise2] = kioskTx.borrow({
itemType: bullsharkType,
itemId: secondFrenObjectId.
const [coin2, promise2] = kioskTx.borrow({
itemType: myType,
itemId: secondCoinObjectId.
});

// Let's call the mix function. We skip any payment related stuff here.
txb.moveCall({
target: `${packageId}::mix_app::mix`,
arguments: [
fren1,
fren2,
coin1,
coin2,
kioskTx.getKiosk(),
kioskTx.getKioskCap(),
]
typeArguments: [bullsharkType],
typeArguments: [myType],
});

kioskTx.return({
itemType: bullsharkType,
item: fren1,
itemType: myType,
item: coin1,
promise: promise1
})
.return({
itemType: bullsharkType,
item: fren2,
itemType: myType,
item: coin2,
promise: promise2
}).finalize();

Expand Down

0 comments on commit cd42dcf

Please sign in to comment.