@tradeport/sui-trading-sdk 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/methods/migrateNftsFromUnsharedToSharedKiosks/migrateNftsFromUnsharedToSharedKiosks.ts +6 -8
package/package.json
CHANGED
package/src/methods/migrateNftsFromUnsharedToSharedKiosks/migrateNftsFromUnsharedToSharedKiosks.ts
CHANGED
|
@@ -11,11 +11,11 @@ import { addTradeportKioskTransferTx } from '../transferNfts/addTransferNftTx';
|
|
|
11
11
|
|
|
12
12
|
export type MigrateNftsFromUnsharedToSharedKiosks = {
|
|
13
13
|
walletAddress: string;
|
|
14
|
-
max
|
|
14
|
+
max?: number;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export async function migrateNftsFromUnsharedToSharedKiosks(
|
|
18
|
-
{ walletAddress, max }: MigrateNftsFromUnsharedToSharedKiosks,
|
|
18
|
+
{ walletAddress, max = 5 }: MigrateNftsFromUnsharedToSharedKiosks,
|
|
19
19
|
context: RequestContext,
|
|
20
20
|
): Promise<Transaction> {
|
|
21
21
|
const tx = new Transaction();
|
|
@@ -28,15 +28,14 @@ export async function migrateNftsFromUnsharedToSharedKiosks(
|
|
|
28
28
|
|
|
29
29
|
const unsharedOBKiosks = res?.kiosks
|
|
30
30
|
?.filter((k: any) => !k.is_shared && k.is_origin_byte)
|
|
31
|
-
?.map((k: any) => k.id)
|
|
32
|
-
?.slice(0, 5);
|
|
31
|
+
?.map((k: any) => k.id);
|
|
33
32
|
|
|
34
33
|
let currentMigrationCount = 0;
|
|
35
34
|
|
|
36
35
|
const sharedOBKiosk = res?.kiosks?.filter((k: any) => k.is_shared && k.is_origin_byte)?.[0]?.id;
|
|
37
36
|
|
|
38
37
|
for (const unsharedOBKiosk of unsharedOBKiosks) {
|
|
39
|
-
if (currentMigrationCount >=
|
|
38
|
+
if (currentMigrationCount >= max) {
|
|
40
39
|
continue;
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -99,11 +98,10 @@ export async function migrateNftsFromUnsharedToSharedKiosks(
|
|
|
99
98
|
|
|
100
99
|
const unsharedNativeKiosks = res?.kiosks
|
|
101
100
|
?.filter((k: any) => !k.is_shared && !k.is_origin_byte)
|
|
102
|
-
?.map((k: any) => k.id)
|
|
103
|
-
?.slice(0, 5);
|
|
101
|
+
?.map((k: any) => k.id);
|
|
104
102
|
|
|
105
103
|
for (const unsharedNativeKiosk of unsharedNativeKiosks) {
|
|
106
|
-
if (currentMigrationCount >=
|
|
104
|
+
if (currentMigrationCount >= max) {
|
|
107
105
|
continue;
|
|
108
106
|
}
|
|
109
107
|
|