@bosonprotocol/core-sdk 1.44.0-alpha.0 → 1.44.0-alpha.1

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 (302) hide show
  1. package/dist/cjs/accounts/handler.d.ts +115 -1
  2. package/dist/cjs/accounts/handler.d.ts.map +1 -1
  3. package/dist/cjs/accounts/handler.js +126 -28
  4. package/dist/cjs/accounts/handler.js.map +1 -1
  5. package/dist/cjs/accounts/mixin.d.ts +105 -8
  6. package/dist/cjs/accounts/mixin.d.ts.map +1 -1
  7. package/dist/cjs/accounts/mixin.js +162 -122
  8. package/dist/cjs/accounts/mixin.js.map +1 -1
  9. package/dist/cjs/core-sdk.d.ts +6 -6
  10. package/dist/cjs/core-sdk.d.ts.map +1 -1
  11. package/dist/cjs/core-sdk.js.map +1 -1
  12. package/dist/cjs/disputes/handler.d.ts +77 -1
  13. package/dist/cjs/disputes/handler.d.ts.map +1 -1
  14. package/dist/cjs/disputes/handler.js +90 -20
  15. package/dist/cjs/disputes/handler.js.map +1 -1
  16. package/dist/cjs/disputes/mixin.d.ts +29 -11
  17. package/dist/cjs/disputes/mixin.d.ts.map +1 -1
  18. package/dist/cjs/disputes/mixin.js +97 -88
  19. package/dist/cjs/disputes/mixin.js.map +1 -1
  20. package/dist/cjs/erc1155/mixin.d.ts +2 -1
  21. package/dist/cjs/erc1155/mixin.d.ts.map +1 -1
  22. package/dist/cjs/erc1155/mixin.js.map +1 -1
  23. package/dist/cjs/erc165/mixin.d.ts +2 -1
  24. package/dist/cjs/erc165/mixin.d.ts.map +1 -1
  25. package/dist/cjs/erc165/mixin.js.map +1 -1
  26. package/dist/cjs/erc20/handler.d.ts +11 -2
  27. package/dist/cjs/erc20/handler.d.ts.map +1 -1
  28. package/dist/cjs/erc20/handler.js +8 -1
  29. package/dist/cjs/erc20/handler.js.map +1 -1
  30. package/dist/cjs/erc20/mixin.d.ts +20 -3
  31. package/dist/cjs/erc20/mixin.d.ts.map +1 -1
  32. package/dist/cjs/erc20/mixin.js +15 -10
  33. package/dist/cjs/erc20/mixin.js.map +1 -1
  34. package/dist/cjs/erc721/handler.d.ts +11 -2
  35. package/dist/cjs/erc721/handler.d.ts.map +1 -1
  36. package/dist/cjs/erc721/handler.js +8 -2
  37. package/dist/cjs/erc721/handler.js.map +1 -1
  38. package/dist/cjs/erc721/mixin.d.ts +2 -1
  39. package/dist/cjs/erc721/mixin.d.ts.map +1 -1
  40. package/dist/cjs/erc721/mixin.js.map +1 -1
  41. package/dist/cjs/errors/mixin.d.ts +2 -1
  42. package/dist/cjs/errors/mixin.d.ts.map +1 -1
  43. package/dist/cjs/errors/mixin.js.map +1 -1
  44. package/dist/cjs/event-logs/mixin.d.ts +2 -1
  45. package/dist/cjs/event-logs/mixin.d.ts.map +1 -1
  46. package/dist/cjs/event-logs/mixin.js.map +1 -1
  47. package/dist/cjs/exchanges/handler.d.ts +44 -1
  48. package/dist/cjs/exchanges/handler.d.ts.map +1 -1
  49. package/dist/cjs/exchanges/handler.js +76 -17
  50. package/dist/cjs/exchanges/handler.js.map +1 -1
  51. package/dist/cjs/exchanges/mixin.d.ts +24 -8
  52. package/dist/cjs/exchanges/mixin.d.ts.map +1 -1
  53. package/dist/cjs/exchanges/mixin.js +72 -72
  54. package/dist/cjs/exchanges/mixin.js.map +1 -1
  55. package/dist/cjs/funds/handler.d.ts +27 -1
  56. package/dist/cjs/funds/handler.d.ts.map +1 -1
  57. package/dist/cjs/funds/handler.js +28 -7
  58. package/dist/cjs/funds/handler.js.map +1 -1
  59. package/dist/cjs/funds/mixin.d.ts +50 -17
  60. package/dist/cjs/funds/mixin.d.ts.map +1 -1
  61. package/dist/cjs/funds/mixin.js +48 -46
  62. package/dist/cjs/funds/mixin.js.map +1 -1
  63. package/dist/cjs/groups/handler.d.ts +8 -1
  64. package/dist/cjs/groups/handler.d.ts.map +1 -1
  65. package/dist/cjs/groups/handler.js +9 -2
  66. package/dist/cjs/groups/handler.js.map +1 -1
  67. package/dist/cjs/groups/mixin.d.ts +12 -4
  68. package/dist/cjs/groups/mixin.d.ts.map +1 -1
  69. package/dist/cjs/groups/mixin.js +10 -8
  70. package/dist/cjs/groups/mixin.js.map +1 -1
  71. package/dist/cjs/marketplaces/mixin.d.ts +2 -1
  72. package/dist/cjs/marketplaces/mixin.d.ts.map +1 -1
  73. package/dist/cjs/marketplaces/mixin.js.map +1 -1
  74. package/dist/cjs/meta-tx/handler.d.ts.map +1 -1
  75. package/dist/cjs/meta-tx/handler.js +4 -2
  76. package/dist/cjs/meta-tx/handler.js.map +1 -1
  77. package/dist/cjs/meta-tx/mixin.d.ts +2 -2
  78. package/dist/cjs/meta-tx/mixin.d.ts.map +1 -1
  79. package/dist/cjs/meta-tx/mixin.js.map +1 -1
  80. package/dist/cjs/metadata/mixin.d.ts +2 -1
  81. package/dist/cjs/metadata/mixin.d.ts.map +1 -1
  82. package/dist/cjs/metadata/mixin.js.map +1 -1
  83. package/dist/cjs/mixins/base-core-sdk.d.ts +4 -4
  84. package/dist/cjs/mixins/base-core-sdk.d.ts.map +1 -1
  85. package/dist/cjs/mixins/base-core-sdk.js.map +1 -1
  86. package/dist/cjs/native-meta-tx/handler.d.ts.map +1 -1
  87. package/dist/cjs/native-meta-tx/handler.js +2 -1
  88. package/dist/cjs/native-meta-tx/handler.js.map +1 -1
  89. package/dist/cjs/native-meta-tx/mixin.d.ts +2 -2
  90. package/dist/cjs/native-meta-tx/mixin.d.ts.map +1 -1
  91. package/dist/cjs/native-meta-tx/mixin.js.map +1 -1
  92. package/dist/cjs/offers/handler.d.ts +79 -0
  93. package/dist/cjs/offers/handler.d.ts.map +1 -1
  94. package/dist/cjs/offers/handler.js +81 -17
  95. package/dist/cjs/offers/handler.js.map +1 -1
  96. package/dist/cjs/offers/mixin.d.ts +53 -2
  97. package/dist/cjs/offers/mixin.d.ts.map +1 -1
  98. package/dist/cjs/offers/mixin.js +101 -97
  99. package/dist/cjs/offers/mixin.js.map +1 -1
  100. package/dist/cjs/orchestration/handler.d.ts +86 -1
  101. package/dist/cjs/orchestration/handler.d.ts.map +1 -1
  102. package/dist/cjs/orchestration/handler.js +64 -16
  103. package/dist/cjs/orchestration/handler.js.map +1 -1
  104. package/dist/cjs/orchestration/mixin.d.ts +2 -2
  105. package/dist/cjs/orchestration/mixin.d.ts.map +1 -1
  106. package/dist/cjs/orchestration/mixin.js.map +1 -1
  107. package/dist/cjs/price-discovery/handler.d.ts +11 -1
  108. package/dist/cjs/price-discovery/handler.d.ts.map +1 -1
  109. package/dist/cjs/price-discovery/handler.js +9 -2
  110. package/dist/cjs/price-discovery/handler.js.map +1 -1
  111. package/dist/cjs/price-discovery/mixin.d.ts +16 -4
  112. package/dist/cjs/price-discovery/mixin.d.ts.map +1 -1
  113. package/dist/cjs/price-discovery/mixin.js +14 -12
  114. package/dist/cjs/price-discovery/mixin.js.map +1 -1
  115. package/dist/cjs/protocol-config/handler.d.ts +9 -0
  116. package/dist/cjs/protocol-config/handler.d.ts.map +1 -1
  117. package/dist/cjs/protocol-config/handler.js +10 -3
  118. package/dist/cjs/protocol-config/handler.js.map +1 -1
  119. package/dist/cjs/protocol-config/mixin.d.ts +2 -1
  120. package/dist/cjs/protocol-config/mixin.d.ts.map +1 -1
  121. package/dist/cjs/protocol-config/mixin.js.map +1 -1
  122. package/dist/cjs/subgraph/mixin.d.ts +2 -2
  123. package/dist/cjs/subgraph/mixin.d.ts.map +1 -1
  124. package/dist/cjs/subgraph/mixin.js.map +1 -1
  125. package/dist/cjs/voucher/handler.d.ts +56 -1
  126. package/dist/cjs/voucher/handler.d.ts.map +1 -1
  127. package/dist/cjs/voucher/handler.js +56 -14
  128. package/dist/cjs/voucher/handler.js.map +1 -1
  129. package/dist/cjs/voucher/mixin.d.ts +66 -22
  130. package/dist/cjs/voucher/mixin.d.ts.map +1 -1
  131. package/dist/cjs/voucher/mixin.js +75 -61
  132. package/dist/cjs/voucher/mixin.js.map +1 -1
  133. package/dist/esm/accounts/handler.d.ts +115 -1
  134. package/dist/esm/accounts/handler.d.ts.map +1 -1
  135. package/dist/esm/accounts/handler.js +126 -28
  136. package/dist/esm/accounts/handler.js.map +1 -1
  137. package/dist/esm/accounts/mixin.d.ts +105 -8
  138. package/dist/esm/accounts/mixin.d.ts.map +1 -1
  139. package/dist/esm/accounts/mixin.js +249 -116
  140. package/dist/esm/accounts/mixin.js.map +1 -1
  141. package/dist/esm/core-sdk.d.ts +6 -6
  142. package/dist/esm/core-sdk.d.ts.map +1 -1
  143. package/dist/esm/core-sdk.js.map +1 -1
  144. package/dist/esm/disputes/handler.d.ts +77 -1
  145. package/dist/esm/disputes/handler.d.ts.map +1 -1
  146. package/dist/esm/disputes/handler.js +90 -20
  147. package/dist/esm/disputes/handler.js.map +1 -1
  148. package/dist/esm/disputes/mixin.d.ts +29 -11
  149. package/dist/esm/disputes/mixin.d.ts.map +1 -1
  150. package/dist/esm/disputes/mixin.js +155 -90
  151. package/dist/esm/disputes/mixin.js.map +1 -1
  152. package/dist/esm/erc1155/mixin.d.ts +2 -1
  153. package/dist/esm/erc1155/mixin.d.ts.map +1 -1
  154. package/dist/esm/erc1155/mixin.js.map +1 -1
  155. package/dist/esm/erc165/mixin.d.ts +2 -1
  156. package/dist/esm/erc165/mixin.d.ts.map +1 -1
  157. package/dist/esm/erc165/mixin.js.map +1 -1
  158. package/dist/esm/erc20/handler.d.ts +11 -2
  159. package/dist/esm/erc20/handler.d.ts.map +1 -1
  160. package/dist/esm/erc20/handler.js +9 -2
  161. package/dist/esm/erc20/handler.js.map +1 -1
  162. package/dist/esm/erc20/mixin.d.ts +20 -3
  163. package/dist/esm/erc20/mixin.d.ts.map +1 -1
  164. package/dist/esm/erc20/mixin.js +24 -8
  165. package/dist/esm/erc20/mixin.js.map +1 -1
  166. package/dist/esm/erc721/handler.d.ts +11 -2
  167. package/dist/esm/erc721/handler.d.ts.map +1 -1
  168. package/dist/esm/erc721/handler.js +8 -2
  169. package/dist/esm/erc721/handler.js.map +1 -1
  170. package/dist/esm/erc721/mixin.d.ts +2 -1
  171. package/dist/esm/erc721/mixin.d.ts.map +1 -1
  172. package/dist/esm/erc721/mixin.js.map +1 -1
  173. package/dist/esm/errors/mixin.d.ts +2 -1
  174. package/dist/esm/errors/mixin.d.ts.map +1 -1
  175. package/dist/esm/errors/mixin.js.map +1 -1
  176. package/dist/esm/event-logs/mixin.d.ts +2 -1
  177. package/dist/esm/event-logs/mixin.d.ts.map +1 -1
  178. package/dist/esm/event-logs/mixin.js.map +1 -1
  179. package/dist/esm/exchanges/handler.d.ts +44 -1
  180. package/dist/esm/exchanges/handler.d.ts.map +1 -1
  181. package/dist/esm/exchanges/handler.js +80 -16
  182. package/dist/esm/exchanges/handler.js.map +1 -1
  183. package/dist/esm/exchanges/mixin.d.ts +24 -8
  184. package/dist/esm/exchanges/mixin.d.ts.map +1 -1
  185. package/dist/esm/exchanges/mixin.js +120 -72
  186. package/dist/esm/exchanges/mixin.js.map +1 -1
  187. package/dist/esm/funds/handler.d.ts +27 -1
  188. package/dist/esm/funds/handler.d.ts.map +1 -1
  189. package/dist/esm/funds/handler.js +28 -7
  190. package/dist/esm/funds/handler.js.map +1 -1
  191. package/dist/esm/funds/mixin.d.ts +50 -17
  192. package/dist/esm/funds/mixin.d.ts.map +1 -1
  193. package/dist/esm/funds/mixin.js +62 -42
  194. package/dist/esm/funds/mixin.js.map +1 -1
  195. package/dist/esm/groups/handler.d.ts +8 -1
  196. package/dist/esm/groups/handler.d.ts.map +1 -1
  197. package/dist/esm/groups/handler.js +9 -2
  198. package/dist/esm/groups/handler.js.map +1 -1
  199. package/dist/esm/groups/mixin.d.ts +12 -4
  200. package/dist/esm/groups/mixin.d.ts.map +1 -1
  201. package/dist/esm/groups/mixin.js +16 -8
  202. package/dist/esm/groups/mixin.js.map +1 -1
  203. package/dist/esm/marketplaces/mixin.d.ts +2 -1
  204. package/dist/esm/marketplaces/mixin.d.ts.map +1 -1
  205. package/dist/esm/marketplaces/mixin.js.map +1 -1
  206. package/dist/esm/meta-tx/handler.d.ts.map +1 -1
  207. package/dist/esm/meta-tx/handler.js +4 -2
  208. package/dist/esm/meta-tx/handler.js.map +1 -1
  209. package/dist/esm/meta-tx/mixin.d.ts +2 -2
  210. package/dist/esm/meta-tx/mixin.d.ts.map +1 -1
  211. package/dist/esm/meta-tx/mixin.js.map +1 -1
  212. package/dist/esm/metadata/mixin.d.ts +2 -1
  213. package/dist/esm/metadata/mixin.d.ts.map +1 -1
  214. package/dist/esm/metadata/mixin.js.map +1 -1
  215. package/dist/esm/mixins/base-core-sdk.d.ts +4 -4
  216. package/dist/esm/mixins/base-core-sdk.d.ts.map +1 -1
  217. package/dist/esm/mixins/base-core-sdk.js.map +1 -1
  218. package/dist/esm/native-meta-tx/handler.d.ts.map +1 -1
  219. package/dist/esm/native-meta-tx/handler.js +2 -1
  220. package/dist/esm/native-meta-tx/handler.js.map +1 -1
  221. package/dist/esm/native-meta-tx/mixin.d.ts +2 -2
  222. package/dist/esm/native-meta-tx/mixin.d.ts.map +1 -1
  223. package/dist/esm/native-meta-tx/mixin.js.map +1 -1
  224. package/dist/esm/offers/handler.d.ts +79 -0
  225. package/dist/esm/offers/handler.d.ts.map +1 -1
  226. package/dist/esm/offers/handler.js +82 -18
  227. package/dist/esm/offers/handler.js.map +1 -1
  228. package/dist/esm/offers/mixin.d.ts +53 -2
  229. package/dist/esm/offers/mixin.d.ts.map +1 -1
  230. package/dist/esm/offers/mixin.js +161 -97
  231. package/dist/esm/offers/mixin.js.map +1 -1
  232. package/dist/esm/orchestration/handler.d.ts +86 -1
  233. package/dist/esm/orchestration/handler.d.ts.map +1 -1
  234. package/dist/esm/orchestration/handler.js +64 -16
  235. package/dist/esm/orchestration/handler.js.map +1 -1
  236. package/dist/esm/orchestration/mixin.d.ts +2 -2
  237. package/dist/esm/orchestration/mixin.d.ts.map +1 -1
  238. package/dist/esm/orchestration/mixin.js.map +1 -1
  239. package/dist/esm/price-discovery/handler.d.ts +11 -1
  240. package/dist/esm/price-discovery/handler.d.ts.map +1 -1
  241. package/dist/esm/price-discovery/handler.js +9 -2
  242. package/dist/esm/price-discovery/handler.js.map +1 -1
  243. package/dist/esm/price-discovery/mixin.d.ts +16 -4
  244. package/dist/esm/price-discovery/mixin.d.ts.map +1 -1
  245. package/dist/esm/price-discovery/mixin.js +19 -11
  246. package/dist/esm/price-discovery/mixin.js.map +1 -1
  247. package/dist/esm/protocol-config/handler.d.ts +9 -0
  248. package/dist/esm/protocol-config/handler.d.ts.map +1 -1
  249. package/dist/esm/protocol-config/handler.js +10 -3
  250. package/dist/esm/protocol-config/handler.js.map +1 -1
  251. package/dist/esm/protocol-config/mixin.d.ts +2 -1
  252. package/dist/esm/protocol-config/mixin.d.ts.map +1 -1
  253. package/dist/esm/protocol-config/mixin.js.map +1 -1
  254. package/dist/esm/subgraph/mixin.d.ts +2 -2
  255. package/dist/esm/subgraph/mixin.d.ts.map +1 -1
  256. package/dist/esm/subgraph/mixin.js.map +1 -1
  257. package/dist/esm/voucher/handler.d.ts +56 -1
  258. package/dist/esm/voucher/handler.d.ts.map +1 -1
  259. package/dist/esm/voucher/handler.js +56 -14
  260. package/dist/esm/voucher/handler.js.map +1 -1
  261. package/dist/esm/voucher/mixin.d.ts +66 -22
  262. package/dist/esm/voucher/mixin.d.ts.map +1 -1
  263. package/dist/esm/voucher/mixin.js +93 -55
  264. package/dist/esm/voucher/mixin.js.map +1 -1
  265. package/package.json +3 -3
  266. package/src/accounts/handler.ts +369 -42
  267. package/src/accounts/mixin.ts +644 -57
  268. package/src/core-sdk.ts +26 -26
  269. package/src/disputes/handler.ts +257 -31
  270. package/src/disputes/mixin.ts +273 -42
  271. package/src/erc1155/mixin.ts +2 -1
  272. package/src/erc165/mixin.ts +2 -1
  273. package/src/erc20/handler.ts +36 -4
  274. package/src/erc20/mixin.ts +77 -10
  275. package/src/erc721/handler.ts +34 -4
  276. package/src/erc721/mixin.ts +2 -1
  277. package/src/errors/mixin.ts +2 -2
  278. package/src/event-logs/mixin.ts +2 -1
  279. package/src/exchanges/handler.ts +235 -25
  280. package/src/exchanges/mixin.ts +223 -32
  281. package/src/funds/handler.ts +99 -13
  282. package/src/funds/mixin.ts +177 -39
  283. package/src/groups/handler.ts +28 -3
  284. package/src/groups/mixin.ts +50 -7
  285. package/src/marketplaces/mixin.ts +2 -1
  286. package/src/meta-tx/handler.ts +4 -2
  287. package/src/meta-tx/mixin.ts +3 -2
  288. package/src/metadata/mixin.ts +2 -1
  289. package/src/mixins/base-core-sdk.ts +5 -5
  290. package/src/native-meta-tx/handler.ts +2 -1
  291. package/src/native-meta-tx/mixin.ts +8 -2
  292. package/src/offers/handler.ts +276 -27
  293. package/src/offers/mixin.ts +398 -35
  294. package/src/orchestration/handler.ts +259 -24
  295. package/src/orchestration/mixin.ts +8 -2
  296. package/src/price-discovery/handler.ts +35 -4
  297. package/src/price-discovery/mixin.ts +60 -9
  298. package/src/protocol-config/handler.ts +26 -4
  299. package/src/protocol-config/mixin.ts +4 -1
  300. package/src/subgraph/mixin.ts +6 -2
  301. package/src/voucher/handler.ts +192 -22
  302. package/src/voucher/mixin.ts +244 -66
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  Web3LibAdapter,
3
3
  TransactionResponse,
4
+ TransactionRequest,
4
5
  utils,
5
6
  MetadataStorage
6
7
  } from "@bosonprotocol/common";
@@ -70,13 +71,33 @@ export async function findCollectionSalt(args: {
70
71
  return collectionSalt;
71
72
  }
72
73
 
74
+ // Overload: returnTxInfo is true → returns TransactionRequest
73
75
  export async function createSeller(args: {
74
76
  sellerToCreate: CreateSellerArgs;
75
77
  contractAddress: string;
76
78
  web3Lib: Web3LibAdapter;
77
79
  metadataStorage?: MetadataStorage;
78
80
  theGraphStorage?: MetadataStorage;
79
- }): Promise<TransactionResponse> {
81
+ returnTxInfo: true;
82
+ }): Promise<TransactionRequest>;
83
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
84
+ export async function createSeller(args: {
85
+ sellerToCreate: CreateSellerArgs;
86
+ contractAddress: string;
87
+ web3Lib: Web3LibAdapter;
88
+ metadataStorage?: MetadataStorage;
89
+ theGraphStorage?: MetadataStorage;
90
+ returnTxInfo?: false | undefined;
91
+ }): Promise<TransactionResponse>;
92
+ // Implementation
93
+ export async function createSeller(args: {
94
+ sellerToCreate: CreateSellerArgs;
95
+ contractAddress: string;
96
+ web3Lib: Web3LibAdapter;
97
+ metadataStorage?: MetadataStorage;
98
+ theGraphStorage?: MetadataStorage;
99
+ returnTxInfo?: boolean;
100
+ }): Promise<TransactionResponse | TransactionRequest> {
80
101
  const collectionSalt = await findCollectionSalt(args);
81
102
  await Promise.all(
82
103
  [args.sellerToCreate.contractUri, args.sellerToCreate.metadataUri].map(
@@ -88,110 +109,294 @@ export async function createSeller(args: {
88
109
  })
89
110
  )
90
111
  );
91
- return args.web3Lib.sendTransaction({
112
+ const transactionRequest = {
92
113
  to: args.contractAddress,
93
114
  data: encodeCreateSeller(args.sellerToCreate, collectionSalt)
94
- });
115
+ } satisfies TransactionRequest;
116
+ if (args.returnTxInfo) {
117
+ return transactionRequest;
118
+ } else {
119
+ return args.web3Lib.sendTransaction(transactionRequest);
120
+ }
95
121
  }
96
122
 
123
+ // Overload: returnTxInfo is true → returns TransactionRequest
97
124
  export async function updateSeller(args: {
98
125
  sellerUpdates: UpdateSellerArgs;
99
126
  contractAddress: string;
100
127
  web3Lib: Web3LibAdapter;
101
128
  metadataStorage: MetadataStorage;
102
129
  theGraphStorage: MetadataStorage;
103
- }): Promise<TransactionResponse> {
130
+ returnTxInfo: true;
131
+ }): Promise<TransactionRequest>;
132
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
133
+ export async function updateSeller(args: {
134
+ sellerUpdates: UpdateSellerArgs;
135
+ contractAddress: string;
136
+ web3Lib: Web3LibAdapter;
137
+ metadataStorage: MetadataStorage;
138
+ theGraphStorage: MetadataStorage;
139
+ returnTxInfo?: false | undefined;
140
+ }): Promise<TransactionResponse>;
141
+ // Implementation
142
+ export async function updateSeller(args: {
143
+ sellerUpdates: UpdateSellerArgs;
144
+ contractAddress: string;
145
+ web3Lib: Web3LibAdapter;
146
+ metadataStorage: MetadataStorage;
147
+ theGraphStorage: MetadataStorage;
148
+ returnTxInfo?: boolean;
149
+ }): Promise<TransactionResponse | TransactionRequest> {
104
150
  await storeMetadataOnTheGraph({
105
151
  metadataUriOrHash: args.sellerUpdates.metadataUri,
106
152
  metadataStorage: args.metadataStorage,
107
153
  theGraphStorage: args.theGraphStorage
108
154
  });
109
- return args.web3Lib.sendTransaction({
155
+ const transactionRequest = {
110
156
  to: args.contractAddress,
111
157
  data: encodeUpdateSeller(args.sellerUpdates)
112
- });
158
+ } satisfies TransactionRequest;
159
+ if (args.returnTxInfo) {
160
+ return transactionRequest;
161
+ } else {
162
+ return args.web3Lib.sendTransaction(transactionRequest);
163
+ }
113
164
  }
114
165
 
166
+ // Overload: returnTxInfo is true → returns TransactionRequest
115
167
  export async function optInToSellerUpdate(args: {
116
168
  sellerUpdates: OptInToSellerUpdateArgs;
117
169
  contractAddress: string;
118
170
  web3Lib: Web3LibAdapter;
119
- }): Promise<TransactionResponse> {
120
- return args.web3Lib.sendTransaction({
171
+ returnTxInfo: true;
172
+ }): Promise<TransactionRequest>;
173
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
174
+ export async function optInToSellerUpdate(args: {
175
+ sellerUpdates: OptInToSellerUpdateArgs;
176
+ contractAddress: string;
177
+ web3Lib: Web3LibAdapter;
178
+ returnTxInfo?: false | undefined;
179
+ }): Promise<TransactionResponse>;
180
+ // Implementation
181
+ export async function optInToSellerUpdate(args: {
182
+ sellerUpdates: OptInToSellerUpdateArgs;
183
+ contractAddress: string;
184
+ web3Lib: Web3LibAdapter;
185
+ returnTxInfo?: boolean;
186
+ }): Promise<TransactionResponse | TransactionRequest> {
187
+ const transactionRequest = {
121
188
  to: args.contractAddress,
122
189
  data: encodeOptInToSellerUpdate(args.sellerUpdates)
123
- });
190
+ } satisfies TransactionRequest;
191
+ if (args.returnTxInfo) {
192
+ return transactionRequest;
193
+ } else {
194
+ return args.web3Lib.sendTransaction(transactionRequest);
195
+ }
124
196
  }
125
197
 
198
+ // Overload: returnTxInfo is true → returns TransactionRequest
199
+ export async function createDisputeResolver(args: {
200
+ disputeResolverToCreate: CreateDisputeResolverArgs;
201
+ contractAddress: string;
202
+ web3Lib: Web3LibAdapter;
203
+ returnTxInfo: true;
204
+ }): Promise<TransactionRequest>;
205
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
206
+ export async function createDisputeResolver(args: {
207
+ disputeResolverToCreate: CreateDisputeResolverArgs;
208
+ contractAddress: string;
209
+ web3Lib: Web3LibAdapter;
210
+ returnTxInfo?: false | undefined;
211
+ }): Promise<TransactionResponse>;
212
+ // Implementation
126
213
  export async function createDisputeResolver(args: {
127
214
  disputeResolverToCreate: CreateDisputeResolverArgs;
128
215
  contractAddress: string;
129
216
  web3Lib: Web3LibAdapter;
130
- }) {
217
+ returnTxInfo?: boolean;
218
+ }): Promise<TransactionResponse | TransactionRequest> {
131
219
  // TODO: validate metadata
132
220
  // disputeResolverToCreate.metadataUri
133
221
 
134
- return args.web3Lib.sendTransaction({
222
+ const transactionRequest = {
135
223
  to: args.contractAddress,
136
224
  data: encodeCreateDisputeResolver(args.disputeResolverToCreate)
137
- });
225
+ } satisfies TransactionRequest;
226
+ if (args.returnTxInfo) {
227
+ return transactionRequest;
228
+ } else {
229
+ return args.web3Lib.sendTransaction(transactionRequest);
230
+ }
138
231
  }
139
232
 
233
+ // Overload: returnTxInfo is true → returns TransactionRequest
234
+ export async function addFeesToDisputeResolver(args: {
235
+ disputeResolverId: BigNumberish;
236
+ fees: DisputeResolutionFee[];
237
+ contractAddress: string;
238
+ web3Lib: Web3LibAdapter;
239
+ returnTxInfo: true;
240
+ }): Promise<TransactionRequest>;
241
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
242
+ export async function addFeesToDisputeResolver(args: {
243
+ disputeResolverId: BigNumberish;
244
+ fees: DisputeResolutionFee[];
245
+ contractAddress: string;
246
+ web3Lib: Web3LibAdapter;
247
+ returnTxInfo?: false | undefined;
248
+ }): Promise<TransactionResponse>;
249
+ // Implementation
140
250
  export async function addFeesToDisputeResolver(args: {
141
251
  disputeResolverId: BigNumberish;
142
252
  fees: DisputeResolutionFee[];
143
253
  contractAddress: string;
144
254
  web3Lib: Web3LibAdapter;
145
- }) {
146
- return args.web3Lib.sendTransaction({
255
+ returnTxInfo?: boolean;
256
+ }): Promise<TransactionResponse | TransactionRequest> {
257
+ const transactionRequest = {
147
258
  to: args.contractAddress,
148
259
  data: encodeAddFeesToDisputeResolver(args)
149
- });
260
+ } satisfies TransactionRequest;
261
+ if (args.returnTxInfo) {
262
+ return transactionRequest;
263
+ } else {
264
+ return args.web3Lib.sendTransaction(transactionRequest);
265
+ }
150
266
  }
151
267
 
268
+ // Overload: returnTxInfo is true → returns TransactionRequest
269
+ export async function addSellersToAllowList(args: {
270
+ disputeResolverId: BigNumberish;
271
+ sellerAllowList: BigNumberish[];
272
+ contractAddress: string;
273
+ web3Lib: Web3LibAdapter;
274
+ returnTxInfo: true;
275
+ }): Promise<TransactionRequest>;
276
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
152
277
  export async function addSellersToAllowList(args: {
153
278
  disputeResolverId: BigNumberish;
154
279
  sellerAllowList: BigNumberish[];
155
280
  contractAddress: string;
156
281
  web3Lib: Web3LibAdapter;
157
- }) {
158
- return args.web3Lib.sendTransaction({
282
+ returnTxInfo?: false | undefined;
283
+ }): Promise<TransactionResponse>;
284
+ // Implementation
285
+ export async function addSellersToAllowList(args: {
286
+ disputeResolverId: BigNumberish;
287
+ sellerAllowList: BigNumberish[];
288
+ contractAddress: string;
289
+ web3Lib: Web3LibAdapter;
290
+ returnTxInfo?: boolean;
291
+ }): Promise<TransactionResponse | TransactionRequest> {
292
+ const transactionRequest = {
159
293
  to: args.contractAddress,
160
294
  data: encodeAddSellersToAllowList(args)
161
- });
295
+ } satisfies TransactionRequest;
296
+ if (args.returnTxInfo) {
297
+ return transactionRequest;
298
+ } else {
299
+ return args.web3Lib.sendTransaction(transactionRequest);
300
+ }
162
301
  }
163
302
 
303
+ // Overload: returnTxInfo is true → returns TransactionRequest
164
304
  export async function removeFeesFromDisputeResolver(args: {
165
305
  disputeResolverId: BigNumberish;
166
306
  feeTokenAddresses: string[];
167
307
  contractAddress: string;
168
308
  web3Lib: Web3LibAdapter;
169
- }) {
170
- return args.web3Lib.sendTransaction({
309
+ returnTxInfo: true;
310
+ }): Promise<TransactionRequest>;
311
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
312
+ export async function removeFeesFromDisputeResolver(args: {
313
+ disputeResolverId: BigNumberish;
314
+ feeTokenAddresses: string[];
315
+ contractAddress: string;
316
+ web3Lib: Web3LibAdapter;
317
+ returnTxInfo?: false | undefined;
318
+ }): Promise<TransactionResponse>;
319
+ // Implementation
320
+ export async function removeFeesFromDisputeResolver(args: {
321
+ disputeResolverId: BigNumberish;
322
+ feeTokenAddresses: string[];
323
+ contractAddress: string;
324
+ web3Lib: Web3LibAdapter;
325
+ returnTxInfo?: boolean;
326
+ }): Promise<TransactionResponse | TransactionRequest> {
327
+ const transactionRequest = {
171
328
  to: args.contractAddress,
172
329
  data: encodeRemoveFeesFromDisputeResolver(args)
173
- });
330
+ } satisfies TransactionRequest;
331
+ if (args.returnTxInfo) {
332
+ return transactionRequest;
333
+ } else {
334
+ return args.web3Lib.sendTransaction(transactionRequest);
335
+ }
174
336
  }
175
337
 
338
+ // Overload: returnTxInfo is true → returns TransactionRequest
339
+ export async function removeSellersFromAllowList(args: {
340
+ disputeResolverId: BigNumberish;
341
+ sellerAllowList: BigNumberish[];
342
+ contractAddress: string;
343
+ web3Lib: Web3LibAdapter;
344
+ returnTxInfo: true;
345
+ }): Promise<TransactionRequest>;
346
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
176
347
  export async function removeSellersFromAllowList(args: {
177
348
  disputeResolverId: BigNumberish;
178
349
  sellerAllowList: BigNumberish[];
179
350
  contractAddress: string;
180
351
  web3Lib: Web3LibAdapter;
181
- }) {
182
- return args.web3Lib.sendTransaction({
352
+ returnTxInfo?: false | undefined;
353
+ }): Promise<TransactionResponse>;
354
+ // Implementation
355
+ export async function removeSellersFromAllowList(args: {
356
+ disputeResolverId: BigNumberish;
357
+ sellerAllowList: BigNumberish[];
358
+ contractAddress: string;
359
+ web3Lib: Web3LibAdapter;
360
+ returnTxInfo?: boolean;
361
+ }): Promise<TransactionResponse | TransactionRequest> {
362
+ const transactionRequest = {
183
363
  to: args.contractAddress,
184
364
  data: encodeRemoveSellersFromAllowList(args)
185
- });
365
+ } satisfies TransactionRequest;
366
+ if (args.returnTxInfo) {
367
+ return transactionRequest;
368
+ } else {
369
+ return args.web3Lib.sendTransaction(transactionRequest);
370
+ }
186
371
  }
187
372
 
373
+ // Overload: returnTxInfo is true → returns TransactionRequest
374
+ export async function updateDisputeResolver(args: {
375
+ disputeResolverId: BigNumberish;
376
+ updates: DisputeResolverUpdates;
377
+ contractAddress: string;
378
+ web3Lib: Web3LibAdapter;
379
+ subgraphUrl: string;
380
+ returnTxInfo: true;
381
+ }): Promise<TransactionRequest>;
382
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
383
+ export async function updateDisputeResolver(args: {
384
+ disputeResolverId: BigNumberish;
385
+ updates: DisputeResolverUpdates;
386
+ contractAddress: string;
387
+ web3Lib: Web3LibAdapter;
388
+ subgraphUrl: string;
389
+ returnTxInfo?: false | undefined;
390
+ }): Promise<TransactionResponse>;
391
+ // Implementation
188
392
  export async function updateDisputeResolver(args: {
189
393
  disputeResolverId: BigNumberish;
190
394
  updates: DisputeResolverUpdates;
191
395
  contractAddress: string;
192
396
  web3Lib: Web3LibAdapter;
193
397
  subgraphUrl: string;
194
- }) {
398
+ returnTxInfo?: boolean;
399
+ }): Promise<TransactionResponse | TransactionRequest> {
195
400
  const disputeResolver = await getDisputeResolverById(
196
401
  args.subgraphUrl,
197
402
  args.disputeResolverId
@@ -202,7 +407,7 @@ export async function updateDisputeResolver(args: {
202
407
  // TODO: validate metadata
203
408
  // updates.metadataUri
204
409
 
205
- return args.web3Lib.sendTransaction({
410
+ const transactionRequest = {
206
411
  to: args.contractAddress,
207
412
  data: encodeUpdateDisputeResolver({
208
413
  ...disputeResolver,
@@ -211,18 +416,44 @@ export async function updateDisputeResolver(args: {
211
416
  ? utils.timestamp.msToSec(args.updates.escalationResponsePeriodInMS)
212
417
  : disputeResolver.escalationResponsePeriod
213
418
  })
214
- });
419
+ } satisfies TransactionRequest;
420
+ if (args.returnTxInfo) {
421
+ return transactionRequest;
422
+ } else {
423
+ return args.web3Lib.sendTransaction(transactionRequest);
424
+ }
215
425
  }
216
426
 
427
+ // Overload: returnTxInfo is true → returns TransactionRequest
428
+ export async function optInToDisputeResolverUpdate(args: {
429
+ disputeResolverUpdates: OptInToDisputeResolverUpdateArgs;
430
+ contractAddress: string;
431
+ web3Lib: Web3LibAdapter;
432
+ returnTxInfo: true;
433
+ }): Promise<TransactionRequest>;
434
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
217
435
  export async function optInToDisputeResolverUpdate(args: {
218
436
  disputeResolverUpdates: OptInToDisputeResolverUpdateArgs;
219
437
  contractAddress: string;
220
438
  web3Lib: Web3LibAdapter;
221
- }): Promise<TransactionResponse> {
222
- return args.web3Lib.sendTransaction({
439
+ returnTxInfo?: false | undefined;
440
+ }): Promise<TransactionResponse>;
441
+ // Implementation
442
+ export async function optInToDisputeResolverUpdate(args: {
443
+ disputeResolverUpdates: OptInToDisputeResolverUpdateArgs;
444
+ contractAddress: string;
445
+ web3Lib: Web3LibAdapter;
446
+ returnTxInfo?: boolean;
447
+ }): Promise<TransactionResponse | TransactionRequest> {
448
+ const transactionRequest = {
223
449
  to: args.contractAddress,
224
450
  data: encodeOptInToDisputeResolverUpdate(args.disputeResolverUpdates)
225
- });
451
+ } satisfies TransactionRequest;
452
+ if (args.returnTxInfo) {
453
+ return transactionRequest;
454
+ } else {
455
+ return args.web3Lib.sendTransaction(transactionRequest);
456
+ }
226
457
  }
227
458
 
228
459
  function assertDisputeResolver(
@@ -236,13 +467,33 @@ function assertDisputeResolver(
236
467
  }
237
468
  }
238
469
 
470
+ // Overload: returnTxInfo is true → returns TransactionRequest
471
+ export async function createNewCollection(args: {
472
+ collectionToCreate: CreateCollectionArgs;
473
+ contractAddress: string;
474
+ web3Lib: Web3LibAdapter;
475
+ metadataStorage: MetadataStorage;
476
+ theGraphStorage: MetadataStorage;
477
+ returnTxInfo: true;
478
+ }): Promise<TransactionRequest>;
479
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
480
+ export async function createNewCollection(args: {
481
+ collectionToCreate: CreateCollectionArgs;
482
+ contractAddress: string;
483
+ web3Lib: Web3LibAdapter;
484
+ metadataStorage: MetadataStorage;
485
+ theGraphStorage: MetadataStorage;
486
+ returnTxInfo?: false | undefined;
487
+ }): Promise<TransactionResponse>;
488
+ // Implementation
239
489
  export async function createNewCollection(args: {
240
490
  collectionToCreate: CreateCollectionArgs;
241
491
  contractAddress: string;
242
492
  web3Lib: Web3LibAdapter;
243
493
  metadataStorage: MetadataStorage;
244
494
  theGraphStorage: MetadataStorage;
245
- }): Promise<TransactionResponse> {
495
+ returnTxInfo?: boolean;
496
+ }): Promise<TransactionResponse | TransactionRequest> {
246
497
  // call calculateCollectionAddress() to check no collection with the same collectionId already exists
247
498
  if (args.collectionToCreate.sellerId) {
248
499
  const { isAvailable } = await calculateCollectionAddress({
@@ -262,10 +513,15 @@ export async function createNewCollection(args: {
262
513
  metadataStorage: args.metadataStorage,
263
514
  theGraphStorage: args.theGraphStorage
264
515
  });
265
- return args.web3Lib.sendTransaction({
516
+ const transactionRequest = {
266
517
  to: args.contractAddress,
267
518
  data: encodeCreateNewCollection(args.collectionToCreate)
268
- });
519
+ } satisfies TransactionRequest;
520
+ if (args.returnTxInfo) {
521
+ return transactionRequest;
522
+ } else {
523
+ return args.web3Lib.sendTransaction(transactionRequest);
524
+ }
269
525
  }
270
526
 
271
527
  export async function isSellerSaltAvailable(args: {
@@ -298,41 +554,112 @@ export async function calculateCollectionAddress(args: {
298
554
  return decodeCalculateCollectionAddress(result);
299
555
  }
300
556
 
557
+ // Overload: returnTxInfo is true → returns TransactionRequest
558
+ export async function addRoyaltyRecipients(args: {
559
+ sellerId: BigNumberish;
560
+ royaltyRecipients: RoyaltyRecipientInfo[];
561
+ contractAddress: string;
562
+ web3Lib: Web3LibAdapter;
563
+ returnTxInfo: true;
564
+ }): Promise<TransactionRequest>;
565
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
566
+ export async function addRoyaltyRecipients(args: {
567
+ sellerId: BigNumberish;
568
+ royaltyRecipients: RoyaltyRecipientInfo[];
569
+ contractAddress: string;
570
+ web3Lib: Web3LibAdapter;
571
+ returnTxInfo?: false | undefined;
572
+ }): Promise<TransactionResponse>;
573
+ // Implementation
301
574
  export async function addRoyaltyRecipients(args: {
302
575
  sellerId: BigNumberish;
303
576
  royaltyRecipients: RoyaltyRecipientInfo[];
304
577
  contractAddress: string;
305
578
  web3Lib: Web3LibAdapter;
306
- }): Promise<TransactionResponse> {
307
- return args.web3Lib.sendTransaction({
579
+ returnTxInfo?: boolean;
580
+ }): Promise<TransactionResponse | TransactionRequest> {
581
+ const transactionRequest = {
308
582
  to: args.contractAddress,
309
583
  data: encodeAddRoyaltyRecipients(args)
310
- });
584
+ } satisfies TransactionRequest;
585
+ if (args.returnTxInfo) {
586
+ return transactionRequest;
587
+ } else {
588
+ return args.web3Lib.sendTransaction(transactionRequest);
589
+ }
311
590
  }
312
591
 
592
+ // Overload: returnTxInfo is true → returns TransactionRequest
313
593
  export async function updateRoyaltyRecipients(args: {
314
594
  sellerId: BigNumberish;
315
595
  royaltyRecipientIds: BigNumberish[];
316
596
  royaltyRecipients: RoyaltyRecipientInfo[];
317
597
  contractAddress: string;
318
598
  web3Lib: Web3LibAdapter;
319
- }): Promise<TransactionResponse> {
320
- return args.web3Lib.sendTransaction({
599
+ returnTxInfo: true;
600
+ }): Promise<TransactionRequest>;
601
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
602
+ export async function updateRoyaltyRecipients(args: {
603
+ sellerId: BigNumberish;
604
+ royaltyRecipientIds: BigNumberish[];
605
+ royaltyRecipients: RoyaltyRecipientInfo[];
606
+ contractAddress: string;
607
+ web3Lib: Web3LibAdapter;
608
+ returnTxInfo?: false | undefined;
609
+ }): Promise<TransactionResponse>;
610
+ // Implementation
611
+ export async function updateRoyaltyRecipients(args: {
612
+ sellerId: BigNumberish;
613
+ royaltyRecipientIds: BigNumberish[];
614
+ royaltyRecipients: RoyaltyRecipientInfo[];
615
+ contractAddress: string;
616
+ web3Lib: Web3LibAdapter;
617
+ returnTxInfo?: boolean;
618
+ }): Promise<TransactionResponse | TransactionRequest> {
619
+ const transactionRequest = {
321
620
  to: args.contractAddress,
322
621
  data: encodeUpdateRoyaltyRecipients(args)
323
- });
622
+ } satisfies TransactionRequest;
623
+ if (args.returnTxInfo) {
624
+ return transactionRequest;
625
+ } else {
626
+ return args.web3Lib.sendTransaction(transactionRequest);
627
+ }
324
628
  }
325
629
 
630
+ // Overload: returnTxInfo is true → returns TransactionRequest
326
631
  export async function removeRoyaltyRecipients(args: {
327
632
  sellerId: BigNumberish;
328
633
  royaltyRecipientIds: BigNumberish[];
329
634
  contractAddress: string;
330
635
  web3Lib: Web3LibAdapter;
331
- }): Promise<TransactionResponse> {
332
- return args.web3Lib.sendTransaction({
636
+ returnTxInfo: true;
637
+ }): Promise<TransactionRequest>;
638
+ // Overload: returnTxInfo is false or undefined → returns TransactionResponse
639
+ export async function removeRoyaltyRecipients(args: {
640
+ sellerId: BigNumberish;
641
+ royaltyRecipientIds: BigNumberish[];
642
+ contractAddress: string;
643
+ web3Lib: Web3LibAdapter;
644
+ returnTxInfo?: false | undefined;
645
+ }): Promise<TransactionResponse>;
646
+ // Implementation
647
+ export async function removeRoyaltyRecipients(args: {
648
+ sellerId: BigNumberish;
649
+ royaltyRecipientIds: BigNumberish[];
650
+ contractAddress: string;
651
+ web3Lib: Web3LibAdapter;
652
+ returnTxInfo?: boolean;
653
+ }): Promise<TransactionResponse | TransactionRequest> {
654
+ const transactionRequest = {
333
655
  to: args.contractAddress,
334
656
  data: encodeRemoveRoyaltyRecipients(args)
335
- });
657
+ } satisfies TransactionRequest;
658
+ if (args.returnTxInfo) {
659
+ return transactionRequest;
660
+ } else {
661
+ return args.web3Lib.sendTransaction(transactionRequest);
662
+ }
336
663
  }
337
664
 
338
665
  export async function getRoyaltyRecipients(args: {