@tradeport/sui-trading-sdk 0.1.51 → 0.1.52
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/CHANGELOG.md +6 -0
- package/dist/index.js +25 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/helpers/kiosk/resolveTransferPolicies.ts +25 -19
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -782,8 +782,15 @@ var resolveTransferPolicies = async ({
|
|
|
782
782
|
}
|
|
783
783
|
let canTransferOutsideKiosk = true;
|
|
784
784
|
for (const policy of policies) {
|
|
785
|
-
policy.data.rules.
|
|
786
|
-
|
|
785
|
+
const kioskLockRule = policy.data.rules.find((rule) => rule.includes("kiosk_lock_rule"));
|
|
786
|
+
const personalKioskRule = policy.data.rules.find(
|
|
787
|
+
(rule) => rule.includes("personal_kiosk_rule")
|
|
788
|
+
);
|
|
789
|
+
const otherRules = policy.data.rules.filter(
|
|
790
|
+
(rule) => !rule.includes("kiosk_lock_rule") && !rule.includes("personal_kiosk_rule")
|
|
791
|
+
);
|
|
792
|
+
const sortedRules = [kioskLockRule, personalKioskRule, ...otherRules].filter(Boolean);
|
|
793
|
+
for (const rule of sortedRules) {
|
|
787
794
|
const ruleDefinition = kioskClient_default.rules.find(
|
|
788
795
|
(x) => (0, import_kiosk4.getNormalizedRuleType)(x.rule) === (0, import_kiosk4.getNormalizedRuleType)(rule)
|
|
789
796
|
);
|
|
@@ -796,22 +803,6 @@ var resolveTransferPolicies = async ({
|
|
|
796
803
|
throw new Error(`Using Origin Byte rule ${rule} inside the native kiosk transaction`);
|
|
797
804
|
}
|
|
798
805
|
switch (moduleName) {
|
|
799
|
-
case "royalty_rule":
|
|
800
|
-
case "kiosk_royalty_rule":
|
|
801
|
-
if (shouldSkipResolvingRoyaltyRule)
|
|
802
|
-
break;
|
|
803
|
-
resolveRoyaltyRule({
|
|
804
|
-
tx,
|
|
805
|
-
packageId: rulePackageId,
|
|
806
|
-
moduleName,
|
|
807
|
-
policyId: policy.data.id,
|
|
808
|
-
transferRequest: policy.transferRequest,
|
|
809
|
-
nftType: policy.isCustom && policy.type ? policy.type : nftType,
|
|
810
|
-
price,
|
|
811
|
-
priceObjectArgument,
|
|
812
|
-
coinToSplit
|
|
813
|
-
});
|
|
814
|
-
break;
|
|
815
806
|
case "kiosk_lock_rule":
|
|
816
807
|
canTransferOutsideKiosk = false;
|
|
817
808
|
resolveKioskLockRule({
|
|
@@ -835,6 +826,22 @@ var resolveTransferPolicies = async ({
|
|
|
835
826
|
transferRequest: policy.transferRequest
|
|
836
827
|
});
|
|
837
828
|
break;
|
|
829
|
+
case "royalty_rule":
|
|
830
|
+
case "kiosk_royalty_rule":
|
|
831
|
+
if (shouldSkipResolvingRoyaltyRule)
|
|
832
|
+
break;
|
|
833
|
+
resolveRoyaltyRule({
|
|
834
|
+
tx,
|
|
835
|
+
packageId: rulePackageId,
|
|
836
|
+
moduleName,
|
|
837
|
+
policyId: policy.data.id,
|
|
838
|
+
transferRequest: policy.transferRequest,
|
|
839
|
+
nftType: policy.isCustom && policy.type ? policy.type : nftType,
|
|
840
|
+
price,
|
|
841
|
+
priceObjectArgument,
|
|
842
|
+
coinToSplit
|
|
843
|
+
});
|
|
844
|
+
break;
|
|
838
845
|
case "floor_price_rule":
|
|
839
846
|
resolveFloorPriceRule({
|
|
840
847
|
tx,
|