@tradeport/sui-trading-sdk 0.5.5 → 0.5.6

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.
Files changed (153) hide show
  1. package/dist/index.d.ts +194 -0
  2. package/dist/index.js +7420 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +71 -66
  5. package/.babel.config.js +0 -3
  6. package/.claude/settings.json +0 -5
  7. package/.claude/settings.local.json +0 -5
  8. package/.env.demo +0 -5
  9. package/.eslintrc.json +0 -46
  10. package/.prettierignore +0 -4
  11. package/.prettierrc.json +0 -7
  12. package/.vscode/launch.json +0 -23
  13. package/CHANGELOG.md +0 -746
  14. package/jest.config.js +0 -12
  15. package/src/SuiTradingClient.ts +0 -442
  16. package/src/apiClients/createKioskClient.ts +0 -10
  17. package/src/apiClients/createSuiClient.ts +0 -5
  18. package/src/apiClients/graphqlClient.ts +0 -17
  19. package/src/bigNumberConfig.ts +0 -10
  20. package/src/constants.ts +0 -1052
  21. package/src/graphql/createChainGQLQuery.ts +0 -27
  22. package/src/graphql/gqlChainRequest.ts +0 -21
  23. package/src/graphql/queries/fetchAccountKiosks.ts +0 -12
  24. package/src/graphql/queries/fetchActiveLockStateByNftId.ts +0 -15
  25. package/src/graphql/queries/fetchBidsById.ts +0 -36
  26. package/src/graphql/queries/fetchCollectionBidById.ts +0 -21
  27. package/src/graphql/queries/fetchCollectionBidsAtSamePrice.ts +0 -29
  28. package/src/graphql/queries/fetchCollectionChainState.ts +0 -17
  29. package/src/graphql/queries/fetchCollectionFloorListingForMarket.ts +0 -28
  30. package/src/graphql/queries/fetchCollectionFloorListings.ts +0 -15
  31. package/src/graphql/queries/fetchCollectionsById.ts +0 -39
  32. package/src/graphql/queries/fetchCommissionByListingId.ts +0 -13
  33. package/src/graphql/queries/fetchCryptoToUsdRate.ts +0 -13
  34. package/src/graphql/queries/fetchKiosksByOwner.ts +0 -14
  35. package/src/graphql/queries/fetchListingsById.ts +0 -29
  36. package/src/graphql/queries/fetchListingsByNftId.ts +0 -23
  37. package/src/graphql/queries/fetchLockById.ts +0 -23
  38. package/src/graphql/queries/fetchMultibidById.ts +0 -34
  39. package/src/graphql/queries/fetchNftCollectionChainState.ts +0 -12
  40. package/src/graphql/queries/fetchNftsById.ts +0 -75
  41. package/src/graphql/queries/fetchNftsByKioskId.ts +0 -45
  42. package/src/graphql/queries/fetchOwnerCapByKiosk.ts +0 -10
  43. package/src/graphql/queries/fetchPersonalCapByKiosk.ts +0 -10
  44. package/src/graphql/queries/fetchSharedObjectsByType.ts +0 -12
  45. package/src/graphql/queries/fetchTransferPoliciesByType.ts +0 -12
  46. package/src/graphql/queries/fetchWalletKiosks.ts +0 -14
  47. package/src/graphql/queries/getCommissionByListingId.ts +0 -15
  48. package/src/helpers/addOneDollarFee.ts +0 -17
  49. package/src/helpers/addThirdPartyTxFee.ts +0 -17
  50. package/src/helpers/calculatePremium.ts +0 -9
  51. package/src/helpers/calculateRoyaltyFee.ts +0 -28
  52. package/src/helpers/destroyZeroCoin.ts +0 -14
  53. package/src/helpers/getActiveLockStateByNftId.ts +0 -15
  54. package/src/helpers/getCollectionChainState.ts +0 -31
  55. package/src/helpers/getCollectionFloorPrice.ts +0 -12
  56. package/src/helpers/getLockById.ts +0 -29
  57. package/src/helpers/getMarketFeePrice.ts +0 -82
  58. package/src/helpers/getNftType.ts +0 -38
  59. package/src/helpers/getRoyaltyRuleModule.ts +0 -7
  60. package/src/helpers/getSharedObjects.ts +0 -119
  61. package/src/helpers/getSuiToUsdRate.ts +0 -14
  62. package/src/helpers/getTradeportBiddingContractBidAmount.ts +0 -31
  63. package/src/helpers/getTransferPolicyRuleNamesFromSuiObject.ts +0 -24
  64. package/src/helpers/hasPersonalKioskRule.ts +0 -7
  65. package/src/helpers/hasRoyaltyRule.ts +0 -7
  66. package/src/helpers/hasTransferPolicyRules.ts +0 -6
  67. package/src/helpers/isExpiredListing.ts +0 -9
  68. package/src/helpers/isNonKioskListing.ts +0 -14
  69. package/src/helpers/isSIngleBid.ts +0 -13
  70. package/src/helpers/kiosk/assertNftInSharedKiosk.ts +0 -31
  71. package/src/helpers/kiosk/getKioskCollectionRoyaltyFeeAmount.ts +0 -71
  72. package/src/helpers/kiosk/getKioskIdFromKioskTx.ts +0 -29
  73. package/src/helpers/kiosk/getKioskPlaceBidCoin.ts +0 -59
  74. package/src/helpers/kiosk/getNativeKioskTransferPolicies.ts +0 -29
  75. package/src/helpers/kiosk/getNativeKioskTransferPoliciesByNftType.ts +0 -21
  76. package/src/helpers/kiosk/getRulePackageId.ts +0 -59
  77. package/src/helpers/kiosk/getTransferPoliciesToResolve.ts +0 -154
  78. package/src/helpers/kiosk/isBluemoveKioskBid.ts +0 -1
  79. package/src/helpers/kiosk/isTradePortKioskBid.ts +0 -4
  80. package/src/helpers/kiosk/kioskListingBcs.ts +0 -19
  81. package/src/helpers/kiosk/kioskTxWrapper.ts +0 -152
  82. package/src/helpers/kiosk/lockNftInsideKioskIfNotLocked.ts +0 -100
  83. package/src/helpers/kiosk/preProcessSharedBulkBuyingData.ts +0 -171
  84. package/src/helpers/kiosk/resolveCustomTransferPolicyRules.ts +0 -75
  85. package/src/helpers/kiosk/resolveFloorPriceRule.ts +0 -21
  86. package/src/helpers/kiosk/resolveKioskLockRule.ts +0 -47
  87. package/src/helpers/kiosk/resolvePersonalKioskRule.ts +0 -23
  88. package/src/helpers/kiosk/resolveRoyaltyRule.ts +0 -57
  89. package/src/helpers/kiosk/resolveTableAllowlistRule.ts +0 -34
  90. package/src/helpers/kiosk/resolveTransferPolicies.ts +0 -158
  91. package/src/helpers/kiosk/sharedKioskState.type.ts +0 -11
  92. package/src/helpers/kiosk/takeAndBorrowNftFromKiosk.ts +0 -50
  93. package/src/helpers/kiosk/takeLockedNftFromKiosk.ts +0 -73
  94. package/src/helpers/kiosk/upgradeKioskRulesPackageId.ts +0 -17
  95. package/src/helpers/originByte/confirmOBTranfer.ts +0 -33
  96. package/src/helpers/originByte/createOBKiosk.ts +0 -14
  97. package/src/helpers/originByte/depositNftIntoOBKiosk.ts +0 -16
  98. package/src/helpers/originByte/getOBBidderKiosk.ts +0 -12
  99. package/src/helpers/originByte/getOBKiosk.ts +0 -24
  100. package/src/helpers/originByte/getOrCreateOBKiosk.ts +0 -42
  101. package/src/helpers/originByte/isOBKiosk.ts +0 -13
  102. package/src/helpers/originByte/isOriginByteBid.ts +0 -30
  103. package/src/helpers/originByte/isOriginByteCollection.ts +0 -11
  104. package/src/helpers/originByte/shareOriginByteKiosk.ts +0 -14
  105. package/src/helpers/rpc/getAcountBalance.ts +0 -18
  106. package/src/helpers/rpc/getObjectType.ts +0 -25
  107. package/src/helpers/splitCoins.ts +0 -12
  108. package/src/helpers/track.ts +0 -20
  109. package/src/helpers/validateMinFloorPrice.ts +0 -22
  110. package/src/index.ts +0 -2
  111. package/src/methods/acceptCollectionBid/acceptCollectionBid.ts +0 -189
  112. package/src/methods/acceptCollectionBid/addAcceptCollectionBIdTxs.ts +0 -398
  113. package/src/methods/acceptNftBids/acceptNftBids.ts +0 -174
  114. package/src/methods/acceptNftBids/addAcceptNftBidTxs.ts +0 -438
  115. package/src/methods/applyFtStrategy/applyFtStrategy.ts +0 -55
  116. package/src/methods/applyNftStrategy/applyNftStrategy.ts +0 -90
  117. package/src/methods/buyListings/addBuyListingTxs.ts +0 -806
  118. package/src/methods/buyListings/buyListings.ts +0 -230
  119. package/src/methods/cancelMultiBid/cancelMultiBid.ts +0 -51
  120. package/src/methods/cancelNftTransfers/addCancelNftTransfersTx.ts +0 -20
  121. package/src/methods/cancelNftTransfers/cancelNftTransfers.ts +0 -118
  122. package/src/methods/claimNfts/addClaimNftsTxs.ts +0 -247
  123. package/src/methods/claimNfts/claimNfts.ts +0 -270
  124. package/src/methods/createMultiBid/createMultiBid.ts +0 -36
  125. package/src/methods/listNfts/addListTxs.ts +0 -210
  126. package/src/methods/listNfts/addRelistTxs.ts +0 -87
  127. package/src/methods/listNfts/listNfts.ts +0 -152
  128. package/src/methods/migrateNftsFromUnsharedToSharedKiosks/migrateNftsFromUnsharedToSharedKiosks.ts +0 -226
  129. package/src/methods/placeCollectionBids/addPlaceCollectionBidTxs.ts +0 -149
  130. package/src/methods/placeCollectionBids/placeCollectionBids.ts +0 -153
  131. package/src/methods/placeNftBids/addPlaceNftBidTxs.ts +0 -154
  132. package/src/methods/placeNftBids/placeNftBids.ts +0 -111
  133. package/src/methods/relistNft/relistNft.ts +0 -153
  134. package/src/methods/removeCollectionBids/addRemoveCollectionBidsTxs.ts +0 -132
  135. package/src/methods/removeCollectionBids/removeCollectionBids.ts +0 -117
  136. package/src/methods/removeNftBids/addRemoveNftBidTxs.ts +0 -122
  137. package/src/methods/removeNftBids/removeNftBids.ts +0 -116
  138. package/src/methods/sponsorNftListing/addSponsorNftListingTx.ts +0 -40
  139. package/src/methods/sponsorNftListing/sponsorNftListing.ts +0 -60
  140. package/src/methods/transferNfts/addTransferNftTx.ts +0 -220
  141. package/src/methods/transferNfts/transferNfts.ts +0 -216
  142. package/src/methods/unlistListings/addUnlistListingTxs.ts +0 -399
  143. package/src/methods/unlistListings/unlistListings.ts +0 -158
  144. package/src/methods/updateMultiBid/updateMultiBid.ts +0 -66
  145. package/src/methods/withdrawProfitsFromKiosks/withdrawProfitsFromKiosks.ts +0 -100
  146. package/src/tests/SuiWallet.ts +0 -83
  147. package/src/utils/addHexPrefix.ts +0 -7
  148. package/src/utils/addLeadingZerosAfter0x.ts +0 -9
  149. package/src/utils/normalizeNftType.ts +0 -7
  150. package/src/utils/printTxBlockTxs.ts +0 -11
  151. package/src/utils/pureValues.ts +0 -13
  152. package/src/utils/toUint8Array.ts +0 -12
  153. package/tsconfig.json +0 -16
package/package.json CHANGED
@@ -1,67 +1,72 @@
1
1
  {
2
- "name": "@tradeport/sui-trading-sdk",
3
- "license": "MIT",
4
- "version": "0.5.5",
5
- "type": "module",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "default": "./dist/index.js"
13
- }
14
- },
15
- "devDependencies": {
16
- "@babel/core": "^7.23.3",
17
- "@babel/preset-env": "^7.23.3",
18
- "@changesets/cli": "^2.26.2",
19
- "@types/jest": "^29.5.10",
20
- "@types/ms": "^2.1.0",
21
- "@types/node": "^20.10.0",
22
- "@typescript-eslint/eslint-plugin": "^6.13.1",
23
- "@typescript-eslint/parser": "^6.13.1",
24
- "babel-jest": "^29.7.0",
25
- "dotenv": "^16.3.1",
26
- "eslint": "^8.54.0",
27
- "eslint-config-prettier": "^9.0.0",
28
- "eslint-config-xo": "^0.43.1",
29
- "eslint-config-xo-typescript": "^1.0.1",
30
- "husky": "^8.0.0",
31
- "jest": "^29.7.0",
32
- "lint-staged": "^16.2.7",
33
- "prettier": "^3.1.0",
34
- "ts-jest": "^29.1.1",
35
- "tsup": "^8.0.1",
36
- "typescript": "^5.3.2"
37
- },
38
- "dependencies": {
39
- "@mysten/kiosk": "^1.3.1",
40
- "@mysten/sui": "^2.20.0",
41
- "@types/analytics-node": "^3.1.14",
42
- "analytics-node": "^6.2.0",
43
- "bignumber.js": "^9.3.1",
44
- "graphql": "^16.12.0",
45
- "graphql-request": "^6.1.0",
46
- "ms": "^2.1.3"
47
- },
48
- "publishConfig": {
49
- "access": "public",
50
- "registry": "https://registry.npmjs.org/"
51
- },
52
- "lint-staged": {
53
- "*.ts": [
54
- "eslint --fix",
55
- "bash -c 'tsc --noEmit'",
56
- "prettier --write"
57
- ]
58
- },
59
- "scripts": {
60
- "build": "tsup src/index.ts --sourcemap --format esm --dts",
61
- "release": "pnpm run build && changeset publish",
62
- "lint": "tsc && eslint --fix src/* --ignore-path .gitignore --ext .js,.ts",
63
- "format": "prettier --write \"**/*.+(js|ts|json)\"",
64
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
65
- "pre-commit": "lint-staged"
66
- }
67
- }
2
+ "name": "@tradeport/sui-trading-sdk",
3
+ "license": "MIT",
4
+ "version": "0.5.6",
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
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
3
- };
@@ -1,5 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": ["Bash(pnpm lint:*)"]
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": ["Bash(xxd:*)", "Bash(pnpm tsc:*)", "Bash(npx tsc:*)"]
4
- }
5
- }
package/.env.demo DELETED
@@ -1,5 +0,0 @@
1
- GRAPHQL_API_USER=
2
- GRAPHQL_API_KEY=
3
- SUI_WALLET_SECRET_KEY=
4
- SUI_WALLET_PUBLIC_KEY=
5
- SUI_RPC_URL=
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
@@ -1,4 +0,0 @@
1
- node_modules
2
- dist
3
- /src/utils/getSharedObjects.ts
4
- /src/constants.ts
package/.prettierrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "semi": true,
3
- "tabWidth": 2,
4
- "useTabs": true,
5
- "singleQuote": true,
6
- "printWidth": 100
7
- }
@@ -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
- }