@tradeport/sui-trading-sdk 0.5.1 → 0.5.3
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 +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +71 -66
- package/.babel.config.js +0 -3
- package/.claude/settings.json +0 -5
- package/.env.demo +0 -5
- package/.eslintrc.json +0 -46
- package/.prettierignore +0 -4
- package/.prettierrc.json +0 -7
- package/.vscode/launch.json +0 -23
- package/CHANGELOG.md +0 -746
- package/dist/index.d.mts +0 -193
- package/dist/index.mjs +0 -7386
- package/dist/index.mjs.map +0 -1
- package/jest.config.js +0 -12
- package/src/SuiTradingClient.ts +0 -442
- package/src/apiClients/createKioskClient.ts +0 -10
- package/src/apiClients/createSuiClient.ts +0 -5
- package/src/apiClients/graphqlClient.ts +0 -17
- package/src/bigNumberConfig.ts +0 -10
- package/src/constants.ts +0 -1052
- package/src/graphql/createChainGQLQuery.ts +0 -27
- package/src/graphql/gqlChainRequest.ts +0 -21
- package/src/graphql/queries/fetchAccountKiosks.ts +0 -12
- package/src/graphql/queries/fetchActiveLockStateByNftId.ts +0 -15
- package/src/graphql/queries/fetchBidsById.ts +0 -36
- package/src/graphql/queries/fetchCollectionBidById.ts +0 -21
- package/src/graphql/queries/fetchCollectionBidsAtSamePrice.ts +0 -29
- package/src/graphql/queries/fetchCollectionChainState.ts +0 -17
- package/src/graphql/queries/fetchCollectionFloorListingForMarket.ts +0 -28
- package/src/graphql/queries/fetchCollectionFloorListings.ts +0 -15
- package/src/graphql/queries/fetchCollectionsById.ts +0 -39
- package/src/graphql/queries/fetchCommissionByListingId.ts +0 -13
- package/src/graphql/queries/fetchCryptoToUsdRate.ts +0 -13
- package/src/graphql/queries/fetchKiosksByOwner.ts +0 -14
- package/src/graphql/queries/fetchListingsById.ts +0 -29
- package/src/graphql/queries/fetchListingsByNftId.ts +0 -23
- package/src/graphql/queries/fetchLockById.ts +0 -23
- package/src/graphql/queries/fetchMultibidById.ts +0 -34
- package/src/graphql/queries/fetchNftCollectionChainState.ts +0 -12
- package/src/graphql/queries/fetchNftsById.ts +0 -75
- package/src/graphql/queries/fetchNftsByKioskId.ts +0 -45
- package/src/graphql/queries/fetchOwnerCapByKiosk.ts +0 -10
- package/src/graphql/queries/fetchPersonalCapByKiosk.ts +0 -10
- package/src/graphql/queries/fetchSharedObjectsByType.ts +0 -12
- package/src/graphql/queries/fetchTransferPoliciesByType.ts +0 -12
- package/src/graphql/queries/fetchWalletKiosks.ts +0 -14
- package/src/graphql/queries/getCommissionByListingId.ts +0 -15
- package/src/helpers/addOneDollarFee.ts +0 -17
- package/src/helpers/addThirdPartyTxFee.ts +0 -17
- package/src/helpers/calculatePremium.ts +0 -9
- package/src/helpers/calculateRoyaltyFee.ts +0 -28
- package/src/helpers/destroyZeroCoin.ts +0 -14
- package/src/helpers/getActiveLockStateByNftId.ts +0 -15
- package/src/helpers/getCollectionChainState.ts +0 -31
- package/src/helpers/getCollectionFloorPrice.ts +0 -12
- package/src/helpers/getLockById.ts +0 -29
- package/src/helpers/getMarketFeePrice.ts +0 -82
- package/src/helpers/getNftType.ts +0 -38
- package/src/helpers/getRoyaltyRuleModule.ts +0 -7
- package/src/helpers/getSharedObjects.ts +0 -119
- package/src/helpers/getSuiToUsdRate.ts +0 -14
- package/src/helpers/getTradeportBiddingContractBidAmount.ts +0 -31
- package/src/helpers/getTransferPolicyRuleNamesFromSuiObject.ts +0 -24
- package/src/helpers/hasPersonalKioskRule.ts +0 -7
- package/src/helpers/hasRoyaltyRule.ts +0 -7
- package/src/helpers/hasTransferPolicyRules.ts +0 -6
- package/src/helpers/isExpiredListing.ts +0 -9
- package/src/helpers/isNonKioskListing.ts +0 -14
- package/src/helpers/isSIngleBid.ts +0 -13
- package/src/helpers/kiosk/assertNftInSharedKiosk.ts +0 -31
- package/src/helpers/kiosk/getKioskCollectionRoyaltyFeeAmount.ts +0 -71
- package/src/helpers/kiosk/getKioskIdFromKioskTx.ts +0 -29
- package/src/helpers/kiosk/getKioskPlaceBidCoin.ts +0 -59
- package/src/helpers/kiosk/getNativeKioskTransferPolicies.ts +0 -29
- package/src/helpers/kiosk/getNativeKioskTransferPoliciesByNftType.ts +0 -21
- package/src/helpers/kiosk/getRulePackageId.ts +0 -59
- package/src/helpers/kiosk/getTransferPoliciesToResolve.ts +0 -154
- package/src/helpers/kiosk/isBluemoveKioskBid.ts +0 -1
- package/src/helpers/kiosk/isTradePortKioskBid.ts +0 -4
- package/src/helpers/kiosk/kioskListingBcs.ts +0 -19
- package/src/helpers/kiosk/kioskTxWrapper.ts +0 -152
- package/src/helpers/kiosk/lockNftInsideKioskIfNotLocked.ts +0 -100
- package/src/helpers/kiosk/preProcessSharedBulkBuyingData.ts +0 -171
- package/src/helpers/kiosk/resolveCustomTransferPolicyRules.ts +0 -75
- package/src/helpers/kiosk/resolveFloorPriceRule.ts +0 -21
- package/src/helpers/kiosk/resolveKioskLockRule.ts +0 -47
- package/src/helpers/kiosk/resolvePersonalKioskRule.ts +0 -23
- package/src/helpers/kiosk/resolveRoyaltyRule.ts +0 -57
- package/src/helpers/kiosk/resolveTableAllowlistRule.ts +0 -34
- package/src/helpers/kiosk/resolveTransferPolicies.ts +0 -158
- package/src/helpers/kiosk/sharedKioskState.type.ts +0 -11
- package/src/helpers/kiosk/takeAndBorrowNftFromKiosk.ts +0 -50
- package/src/helpers/kiosk/takeLockedNftFromKiosk.ts +0 -73
- package/src/helpers/kiosk/upgradeKioskRulesPackageId.ts +0 -17
- package/src/helpers/originByte/confirmOBTranfer.ts +0 -33
- package/src/helpers/originByte/createOBKiosk.ts +0 -14
- package/src/helpers/originByte/depositNftIntoOBKiosk.ts +0 -16
- package/src/helpers/originByte/getOBBidderKiosk.ts +0 -12
- package/src/helpers/originByte/getOBKiosk.ts +0 -24
- package/src/helpers/originByte/getOrCreateOBKiosk.ts +0 -42
- package/src/helpers/originByte/isOBKiosk.ts +0 -13
- package/src/helpers/originByte/isOriginByteBid.ts +0 -6
- package/src/helpers/originByte/isOriginByteCollection.ts +0 -11
- package/src/helpers/originByte/shareOriginByteKiosk.ts +0 -14
- package/src/helpers/rpc/getAcountBalance.ts +0 -18
- package/src/helpers/rpc/getObjectType.ts +0 -25
- package/src/helpers/splitCoins.ts +0 -12
- package/src/helpers/track.ts +0 -20
- package/src/helpers/validateMinFloorPrice.ts +0 -22
- package/src/index.ts +0 -2
- package/src/methods/acceptCollectionBid/acceptCollectionBid.ts +0 -189
- package/src/methods/acceptCollectionBid/addAcceptCollectionBIdTxs.ts +0 -398
- package/src/methods/acceptNftBids/acceptNftBids.ts +0 -174
- package/src/methods/acceptNftBids/addAcceptNftBidTxs.ts +0 -438
- package/src/methods/applyFtStrategy/applyFtStrategy.ts +0 -55
- package/src/methods/applyNftStrategy/applyNftStrategy.ts +0 -90
- package/src/methods/buyListings/addBuyListingTxs.ts +0 -803
- package/src/methods/buyListings/buyListings.ts +0 -230
- package/src/methods/cancelMultiBid/cancelMultiBid.ts +0 -51
- package/src/methods/cancelNftTransfers/addCancelNftTransfersTx.ts +0 -20
- package/src/methods/cancelNftTransfers/cancelNftTransfers.ts +0 -118
- package/src/methods/claimNfts/addClaimNftsTxs.ts +0 -247
- package/src/methods/claimNfts/claimNfts.ts +0 -270
- package/src/methods/createMultiBid/createMultiBid.ts +0 -36
- package/src/methods/listNfts/addListTxs.ts +0 -210
- package/src/methods/listNfts/addRelistTxs.ts +0 -87
- package/src/methods/listNfts/listNfts.ts +0 -152
- package/src/methods/migrateNftsFromUnsharedToSharedKiosks/migrateNftsFromUnsharedToSharedKiosks.ts +0 -226
- package/src/methods/placeCollectionBids/addPlaceCollectionBidTxs.ts +0 -149
- package/src/methods/placeCollectionBids/placeCollectionBids.ts +0 -153
- package/src/methods/placeNftBids/addPlaceNftBidTxs.ts +0 -154
- package/src/methods/placeNftBids/placeNftBids.ts +0 -111
- package/src/methods/relistNft/relistNft.ts +0 -153
- package/src/methods/removeCollectionBids/addRemoveCollectionBidsTxs.ts +0 -132
- package/src/methods/removeCollectionBids/removeCollectionBids.ts +0 -117
- package/src/methods/removeNftBids/addRemoveNftBidTxs.ts +0 -122
- package/src/methods/removeNftBids/removeNftBids.ts +0 -116
- package/src/methods/sponsorNftListing/addSponsorNftListingTx.ts +0 -40
- package/src/methods/sponsorNftListing/sponsorNftListing.ts +0 -60
- package/src/methods/transferNfts/addTransferNftTx.ts +0 -220
- package/src/methods/transferNfts/transferNfts.ts +0 -216
- package/src/methods/unlistListings/addUnlistListingTxs.ts +0 -399
- package/src/methods/unlistListings/unlistListings.ts +0 -158
- package/src/methods/updateMultiBid/updateMultiBid.ts +0 -66
- package/src/methods/withdrawProfitsFromKiosks/withdrawProfitsFromKiosks.ts +0 -100
- package/src/tests/SuiWallet.ts +0 -83
- package/src/utils/addHexPrefix.ts +0 -7
- package/src/utils/addLeadingZerosAfter0x.ts +0 -9
- package/src/utils/normalizeNftType.ts +0 -7
- package/src/utils/printTxBlockTxs.ts +0 -11
- package/src/utils/pureValues.ts +0 -13
- package/src/utils/toUint8Array.ts +0 -12
- package/tsconfig.json +0 -16
package/package.json
CHANGED
|
@@ -1,67 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
2
|
+
"name": "@tradeport/sui-trading-sdk",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "0.5.3",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup src/index.ts --sourcemap --format esm --dts",
|
|
20
|
+
"prepublishOnly": "pnpm run build",
|
|
21
|
+
"release": "pnpm run build && changeset publish",
|
|
22
|
+
"lint": "tsc && eslint --fix src/* --ignore-path .gitignore --ext .js,.ts",
|
|
23
|
+
"format": "prettier --write \"**/*.+(js|ts|json)\"",
|
|
24
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
25
|
+
"prepare": "husky install",
|
|
26
|
+
"pre-commit": "lint-staged"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@babel/core": "^7.23.3",
|
|
30
|
+
"@babel/preset-env": "^7.23.3",
|
|
31
|
+
"@changesets/cli": "^2.26.2",
|
|
32
|
+
"@types/jest": "^29.5.10",
|
|
33
|
+
"@types/ms": "^2.1.0",
|
|
34
|
+
"@types/node": "^20.10.0",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
|
36
|
+
"@typescript-eslint/parser": "^6.13.1",
|
|
37
|
+
"babel-jest": "^29.7.0",
|
|
38
|
+
"dotenv": "^16.3.1",
|
|
39
|
+
"eslint": "^8.54.0",
|
|
40
|
+
"eslint-config-prettier": "^9.0.0",
|
|
41
|
+
"eslint-config-xo": "^0.43.1",
|
|
42
|
+
"eslint-config-xo-typescript": "^1.0.1",
|
|
43
|
+
"husky": "^8.0.0",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"lint-staged": "^16.2.7",
|
|
46
|
+
"prettier": "^3.1.0",
|
|
47
|
+
"ts-jest": "^29.1.1",
|
|
48
|
+
"tsup": "^8.0.1",
|
|
49
|
+
"typescript": "^5.3.2"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@mysten/kiosk": "^1.3.1",
|
|
53
|
+
"@mysten/sui": "^2.20.0",
|
|
54
|
+
"@types/analytics-node": "^3.1.14",
|
|
55
|
+
"analytics-node": "^6.2.0",
|
|
56
|
+
"bignumber.js": "^9.3.1",
|
|
57
|
+
"graphql": "^16.12.0",
|
|
58
|
+
"graphql-request": "^6.1.0",
|
|
59
|
+
"ms": "^2.1.3"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public",
|
|
63
|
+
"registry": "https://registry.npmjs.org/"
|
|
64
|
+
},
|
|
65
|
+
"lint-staged": {
|
|
66
|
+
"*.ts": [
|
|
67
|
+
"eslint --fix",
|
|
68
|
+
"bash -c 'tsc --noEmit'",
|
|
69
|
+
"prettier --write"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
package/.babel.config.js
DELETED
package/.claude/settings.json
DELETED
package/.env.demo
DELETED
package/.eslintrc.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2022": true,
|
|
5
|
-
"commonjs": true,
|
|
6
|
-
"node": true
|
|
7
|
-
},
|
|
8
|
-
"extends": ["xo", "prettier"],
|
|
9
|
-
"overrides": [
|
|
10
|
-
{
|
|
11
|
-
"extends": ["xo-typescript"],
|
|
12
|
-
"files": ["*.ts"],
|
|
13
|
-
"rules": {
|
|
14
|
-
"@typescript-eslint/naming-convention": "off",
|
|
15
|
-
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
16
|
-
"@typescript-eslint/no-unsafe-return": "off",
|
|
17
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
18
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
19
|
-
"@typescript-eslint/no-unsafe-argument": "off",
|
|
20
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
21
|
-
"@typescript-eslint/no-throw-literal": "off",
|
|
22
|
-
"@typescript-eslint/object-curly-spacing": "off",
|
|
23
|
-
"@typescript-eslint/consistent-type-definitions": "off",
|
|
24
|
-
"@typescript-eslint/no-negated-condition": "off",
|
|
25
|
-
"@typescript-eslint/prefer-ts-expect-error": "off",
|
|
26
|
-
"@typescript-eslint/indent": "off",
|
|
27
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
28
|
-
"complexity": "off",
|
|
29
|
-
"@typescript-eslint/quotes": [
|
|
30
|
-
"error",
|
|
31
|
-
"single",
|
|
32
|
-
{
|
|
33
|
-
"allowTemplateLiterals": true
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"capitalized-comments": "off",
|
|
37
|
-
"no-await-in-loop": "off",
|
|
38
|
-
"no-warning-comments": "off",
|
|
39
|
-
"max-nested-callbacks": ["error", 6]
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"parserOptions": {
|
|
44
|
-
"ecmaVersion": "latest"
|
|
45
|
-
}
|
|
46
|
-
}
|
package/.prettierignore
DELETED
package/.prettierrc.json
DELETED
package/.vscode/launch.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"type": "node",
|
|
6
|
-
"request": "launch",
|
|
7
|
-
"name": "Jest: Current File",
|
|
8
|
-
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
9
|
-
"args": ["--runInBand", "--no-coverage", "${relativeFile}"],
|
|
10
|
-
"console": "integratedTerminal",
|
|
11
|
-
"envFile": "${workspaceFolder}/.env"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"type": "node",
|
|
15
|
-
"request": "launch",
|
|
16
|
-
"name": "Jest: swapCoins",
|
|
17
|
-
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
18
|
-
"args": ["--runInBand", "--no-coverage", "src/tests/swapCoins.test.ts"],
|
|
19
|
-
"console": "integratedTerminal",
|
|
20
|
-
"envFile": "${workspaceFolder}/.env"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|