@tradeport/sui-trading-sdk 0.3.6 → 0.3.7
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 +2 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/methods/transferNfts/addTransferNftTx.ts +2 -30
package/package.json
CHANGED
|
@@ -169,40 +169,12 @@ export function canBeTransferedDirectly(collectionChainState?: CollectionChainSt
|
|
|
169
169
|
export function getTransferPolicyForDirectTransfer(
|
|
170
170
|
collectionChainState?: CollectionChainState,
|
|
171
171
|
): TransferPolicy | undefined {
|
|
172
|
-
|
|
173
|
-
return undefined;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const usablePolicies = collectionChainState.transfer_policies.filter(
|
|
172
|
+
return collectionChainState?.transfer_policies?.find(
|
|
177
173
|
(policy) =>
|
|
178
174
|
!policy.is_origin_byte &&
|
|
175
|
+
policy.rules.length > 0 &&
|
|
179
176
|
policy.rules?.filter(
|
|
180
177
|
(rule) => rule.type !== 'kiosk_lock_rule' && rule.type !== 'royalty_rule',
|
|
181
178
|
).length === 0,
|
|
182
179
|
);
|
|
183
|
-
|
|
184
|
-
const lockAndRoyaltyPolicy = usablePolicies.find(
|
|
185
|
-
(policy) =>
|
|
186
|
-
policy.rules?.some((rule) => rule.type === 'kiosk_lock_rule') &&
|
|
187
|
-
!policy.rules?.some((rule) => rule.type === 'royalty_rule'),
|
|
188
|
-
);
|
|
189
|
-
if (lockAndRoyaltyPolicy) {
|
|
190
|
-
return lockAndRoyaltyPolicy;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const royaltyPolicy = usablePolicies.find((policy) =>
|
|
194
|
-
policy.rules?.some((rule) => rule.type === 'royalty_rule'),
|
|
195
|
-
);
|
|
196
|
-
if (royaltyPolicy) {
|
|
197
|
-
return royaltyPolicy;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const lockPolicy = usablePolicies.find((policy) =>
|
|
201
|
-
policy.rules?.some((rule) => rule.type === 'kiosk_lock_rule'),
|
|
202
|
-
);
|
|
203
|
-
if (lockPolicy) {
|
|
204
|
-
return lockPolicy;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return usablePolicies[0];
|
|
208
180
|
}
|