@tradeport/sui-trading-sdk 0.4.13 → 0.4.14
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.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/helpers/hasTransferPolicyRules.ts +2 -4
- package/src/tests/SuiWallet.ts +13 -7
package/package.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { getNativeKioskTransferPolicies } from './kiosk/getNativeKioskTransferPolicies';
|
|
2
2
|
|
|
3
|
-
export const hasNativeKioskTransferPolicyRules = (transferPolicies: any): boolean =>
|
|
4
|
-
|
|
5
|
-
return nativeKioskTransferPolicies?.some((policy: any) => policy?.rules?.length > 0);
|
|
6
|
-
};
|
|
3
|
+
export const hasNativeKioskTransferPolicyRules = (transferPolicies: any): boolean =>
|
|
4
|
+
getNativeKioskTransferPolicies(transferPolicies)?.length > 0;
|
package/src/tests/SuiWallet.ts
CHANGED
|
@@ -27,14 +27,20 @@ export class SuiWallet {
|
|
|
27
27
|
return 1;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async simulateCall(tx: Transaction): Promise<any> {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
transactionBlock: rawTransaction,
|
|
30
|
+
async simulateCall(tx: Transaction, sender?: string): Promise<any> {
|
|
31
|
+
const result = await this.suiClient.devInspectTransactionBlock({
|
|
32
|
+
transactionBlock: tx,
|
|
33
|
+
sender: sender ?? this.keypair.toSuiAddress(),
|
|
35
34
|
});
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
|
|
36
|
+
if (result?.effects?.status?.status === 'failure') {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`Error on transaction simulation (from effect): ${result.effects.status.error}`,
|
|
39
|
+
); // result.effects.status.error
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (result?.error) {
|
|
43
|
+
throw new Error(`Error on transaction simulation: ${result.error}`); // result.error
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
return result;
|