@bosonprotocol/core-sdk 1.29.0-ludo.1 → 1.29.0
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/LICENSE +202 -0
- package/dist/cjs/accounts/handler.d.ts +63 -63
- package/dist/cjs/accounts/handler.js +129 -129
- package/dist/cjs/accounts/index.d.ts +8 -8
- package/dist/cjs/accounts/index.js +37 -37
- package/dist/cjs/accounts/interface.d.ts +38 -38
- package/dist/cjs/accounts/interface.js +130 -130
- package/dist/cjs/accounts/mixin.d.ts +222 -222
- package/dist/cjs/accounts/mixin.js +506 -506
- package/dist/cjs/accounts/subgraph.d.ts +17 -17
- package/dist/cjs/accounts/subgraph.d.ts.map +1 -1
- package/dist/cjs/accounts/subgraph.js +107 -107
- package/dist/cjs/accounts/types.d.ts +28 -28
- package/dist/cjs/accounts/types.d.ts.map +1 -1
- package/dist/cjs/accounts/types.js +8 -8
- package/dist/cjs/core-sdk.d.ts +55 -55
- package/dist/cjs/core-sdk.js +98 -98
- package/dist/cjs/disputes/handler.d.ts +71 -71
- package/dist/cjs/disputes/handler.js +127 -127
- package/dist/cjs/disputes/index.d.ts +3 -3
- package/dist/cjs/disputes/index.js +29 -29
- package/dist/cjs/disputes/interface.d.ts +28 -28
- package/dist/cjs/disputes/interface.js +72 -72
- package/dist/cjs/disputes/mixin.d.ts +117 -117
- package/dist/cjs/disputes/mixin.js +202 -202
- package/dist/cjs/disputes/subgraph.d.ts +5 -5
- package/dist/cjs/disputes/subgraph.d.ts.map +1 -1
- package/dist/cjs/disputes/subgraph.js +29 -29
- package/dist/cjs/erc1155/handler.d.ts +8 -8
- package/dist/cjs/erc1155/handler.js +27 -27
- package/dist/cjs/erc1155/index.d.ts +2 -2
- package/dist/cjs/erc1155/index.js +28 -28
- package/dist/cjs/erc1155/interface.d.ts +2 -2
- package/dist/cjs/erc1155/interface.js +6 -6
- package/dist/cjs/erc1155/mixin.d.ts +5 -5
- package/dist/cjs/erc1155/mixin.js +25 -25
- package/dist/cjs/erc20/handler.d.ts +38 -38
- package/dist/cjs/erc20/handler.js +88 -88
- package/dist/cjs/erc20/index.d.ts +3 -3
- package/dist/cjs/erc20/index.js +29 -29
- package/dist/cjs/erc20/interface.d.ts +2 -2
- package/dist/cjs/erc20/interface.js +6 -6
- package/dist/cjs/erc20/mixin.d.ts +11 -11
- package/dist/cjs/erc20/mixin.js +55 -55
- package/dist/cjs/erc20/subgraph.d.ts +4 -4
- package/dist/cjs/erc20/subgraph.d.ts.map +1 -1
- package/dist/cjs/erc20/subgraph.js +29 -29
- package/dist/cjs/erc721/handler.d.ts +18 -18
- package/dist/cjs/erc721/handler.js +50 -50
- package/dist/cjs/erc721/index.d.ts +2 -2
- package/dist/cjs/erc721/index.js +28 -28
- package/dist/cjs/erc721/interface.d.ts +2 -2
- package/dist/cjs/erc721/interface.js +6 -6
- package/dist/cjs/erc721/mixin.d.ts +7 -7
- package/dist/cjs/erc721/mixin.js +35 -35
- package/dist/cjs/event-logs/index.d.ts +1 -1
- package/dist/cjs/event-logs/index.js +27 -27
- package/dist/cjs/event-logs/mixin.d.ts +10 -10
- package/dist/cjs/event-logs/mixin.js +27 -27
- package/dist/cjs/event-logs/subgraph.d.ts +2 -2
- package/dist/cjs/event-logs/subgraph.js +21 -21
- package/dist/cjs/exchanges/getExchangeState.d.ts +8 -8
- package/dist/cjs/exchanges/getExchangeState.d.ts.map +1 -1
- package/dist/cjs/exchanges/getExchangeState.js +21 -21
- package/dist/cjs/exchanges/getExchangeState.js.map +1 -1
- package/dist/cjs/exchanges/handler.d.ts +30 -30
- package/dist/cjs/exchanges/handler.d.ts.map +1 -1
- package/dist/cjs/exchanges/handler.js +201 -201
- package/dist/cjs/exchanges/index.d.ts +4 -4
- package/dist/cjs/exchanges/index.js +33 -33
- package/dist/cjs/exchanges/interface.d.ts +10 -10
- package/dist/cjs/exchanges/interface.js +49 -49
- package/dist/cjs/exchanges/mixin.d.ts +76 -76
- package/dist/cjs/exchanges/mixin.js +171 -171
- package/dist/cjs/exchanges/subgraph.d.ts +5 -5
- package/dist/cjs/exchanges/subgraph.d.ts.map +1 -1
- package/dist/cjs/exchanges/subgraph.js +29 -29
- package/dist/cjs/forwarder/biconomy-interface.d.ts +71 -71
- package/dist/cjs/forwarder/biconomy-interface.d.ts.map +1 -1
- package/dist/cjs/forwarder/biconomy-interface.js +30 -30
- package/dist/cjs/forwarder/handler.d.ts +18 -18
- package/dist/cjs/forwarder/handler.js +76 -76
- package/dist/cjs/forwarder/index.d.ts +3 -3
- package/dist/cjs/forwarder/index.js +29 -29
- package/dist/cjs/forwarder/mock-interface.d.ts +40 -40
- package/dist/cjs/forwarder/mock-interface.d.ts.map +1 -1
- package/dist/cjs/forwarder/mock-interface.js +15 -15
- package/dist/cjs/funds/handler.d.ts +22 -22
- package/dist/cjs/funds/handler.js +64 -64
- package/dist/cjs/funds/index.d.ts +3 -3
- package/dist/cjs/funds/index.js +29 -29
- package/dist/cjs/funds/interface.d.ts +5 -5
- package/dist/cjs/funds/interface.js +22 -22
- package/dist/cjs/funds/mixin.d.ts +41 -41
- package/dist/cjs/funds/mixin.js +94 -94
- package/dist/cjs/funds/subgraph.d.ts +5 -5
- package/dist/cjs/funds/subgraph.d.ts.map +1 -1
- package/dist/cjs/funds/subgraph.js +29 -29
- package/dist/cjs/groups/handler.d.ts +6 -6
- package/dist/cjs/groups/handler.js +22 -22
- package/dist/cjs/groups/index.d.ts +3 -3
- package/dist/cjs/groups/index.js +29 -29
- package/dist/cjs/groups/interface.d.ts +5 -5
- package/dist/cjs/groups/interface.js +28 -28
- package/dist/cjs/groups/mixin.d.ts +13 -13
- package/dist/cjs/groups/mixin.js +32 -32
- package/dist/cjs/groups/subgraph.d.ts +1 -1
- package/dist/cjs/groups/subgraph.js +4 -4
- package/dist/cjs/index.d.ts +17 -17
- package/dist/cjs/index.js +51 -51
- package/dist/cjs/meta-tx/biconomy.d.ts +59 -59
- package/dist/cjs/meta-tx/biconomy.d.ts.map +1 -1
- package/dist/cjs/meta-tx/biconomy.js +107 -107
- package/dist/cjs/meta-tx/handler.d.ts +230 -230
- package/dist/cjs/meta-tx/handler.d.ts.map +1 -1
- package/dist/cjs/meta-tx/handler.js +665 -665
- package/dist/cjs/meta-tx/index.d.ts +2 -2
- package/dist/cjs/meta-tx/index.js +28 -28
- package/dist/cjs/meta-tx/interface.d.ts +2 -2
- package/dist/cjs/meta-tx/interface.js +6 -6
- package/dist/cjs/meta-tx/mixin.d.ts +219 -219
- package/dist/cjs/meta-tx/mixin.js +474 -474
- package/dist/cjs/metadata/index.d.ts +1 -1
- package/dist/cjs/metadata/index.js +27 -27
- package/dist/cjs/metadata/mixin.d.ts +41 -41
- package/dist/cjs/metadata/mixin.js +88 -88
- package/dist/cjs/metadata/subgraph.d.ts +20 -20
- package/dist/cjs/metadata/subgraph.d.ts.map +1 -1
- package/dist/cjs/metadata/subgraph.js +108 -108
- package/dist/cjs/mixins/base-core-sdk.d.ts +44 -44
- package/dist/cjs/mixins/base-core-sdk.js +52 -52
- package/dist/cjs/native-meta-tx/handler.d.ts +42 -42
- package/dist/cjs/native-meta-tx/handler.js +135 -135
- package/dist/cjs/native-meta-tx/index.d.ts +2 -2
- package/dist/cjs/native-meta-tx/index.js +28 -28
- package/dist/cjs/native-meta-tx/interface.d.ts +3 -3
- package/dist/cjs/native-meta-tx/interface.js +29 -29
- package/dist/cjs/native-meta-tx/mixin.d.ts +34 -34
- package/dist/cjs/native-meta-tx/mixin.js +67 -67
- package/dist/cjs/native-meta-tx/tokenSpecifics.d.ts +6 -6
- package/dist/cjs/native-meta-tx/tokenSpecifics.d.ts.map +1 -1
- package/dist/cjs/native-meta-tx/tokenSpecifics.js +20 -20
- package/dist/cjs/offers/checkExchangePolicy.d.ts +48 -48
- package/dist/cjs/offers/checkExchangePolicy.d.ts.map +1 -1
- package/dist/cjs/offers/checkExchangePolicy.js +24 -24
- package/dist/cjs/offers/getOfferStatus.d.ts +8 -8
- package/dist/cjs/offers/getOfferStatus.js +25 -25
- package/dist/cjs/offers/getOfferStatus.js.map +1 -1
- package/dist/cjs/offers/handler.d.ts +51 -51
- package/dist/cjs/offers/handler.js +151 -151
- package/dist/cjs/offers/index.d.ts +12 -12
- package/dist/cjs/offers/index.js +41 -41
- package/dist/cjs/offers/interface.d.ts +18 -18
- package/dist/cjs/offers/interface.js +91 -91
- package/dist/cjs/offers/mixin.d.ts +170 -170
- package/dist/cjs/offers/mixin.js +408 -408
- package/dist/cjs/offers/renderContractualAgreement.d.ts +53 -53
- package/dist/cjs/offers/renderContractualAgreement.d.ts.map +1 -1
- package/dist/cjs/offers/renderContractualAgreement.js +232 -232
- package/dist/cjs/offers/storage.d.ts +12 -12
- package/dist/cjs/offers/storage.js +29 -29
- package/dist/cjs/offers/subgraph.d.ts +5 -5
- package/dist/cjs/offers/subgraph.d.ts.map +1 -1
- package/dist/cjs/offers/subgraph.js +29 -29
- package/dist/cjs/offers/types.d.ts +1 -1
- package/dist/cjs/offers/types.js +2 -2
- package/dist/cjs/orchestration/handler.d.ts +73 -73
- package/dist/cjs/orchestration/handler.js +146 -146
- package/dist/cjs/orchestration/index.d.ts +2 -2
- package/dist/cjs/orchestration/index.js +28 -28
- package/dist/cjs/orchestration/interface.d.ts +14 -14
- package/dist/cjs/orchestration/interface.js +114 -114
- package/dist/cjs/orchestration/mixin.d.ts +84 -84
- package/dist/cjs/orchestration/mixin.js +163 -163
- package/dist/cjs/seaport/abi.d.ts +40 -40
- package/dist/cjs/seaport/abi.js +152 -152
- package/dist/cjs/seaport/handler.d.ts +45 -45
- package/dist/cjs/seaport/handler.d.ts.map +1 -1
- package/dist/cjs/seaport/handler.js +27 -27
- package/dist/cjs/seaport/handler.js.map +1 -1
- package/dist/cjs/seaport/index.d.ts +1 -1
- package/dist/cjs/seaport/index.js +27 -27
- package/dist/cjs/subgraph.d.ts +33033 -33033
- package/dist/cjs/subgraph.d.ts.map +1 -1
- package/dist/cjs/subgraph.js +854 -854
- package/dist/cjs/subgraph.js.map +1 -1
- package/dist/cjs/utils/errors.d.ts +4 -4
- package/dist/cjs/utils/errors.js +10 -10
- package/dist/cjs/utils/graphql.d.ts +315 -315
- package/dist/cjs/utils/graphql.js +10 -10
- package/dist/cjs/utils/logs.d.ts +20 -20
- package/dist/cjs/utils/logs.js +53 -53
- package/dist/cjs/utils/signature.d.ts +23 -23
- package/dist/cjs/utils/signature.d.ts.map +1 -1
- package/dist/cjs/utils/signature.js +64 -64
- package/dist/cjs/utils/tokenInfoManager.d.ts +23 -23
- package/dist/cjs/utils/tokenInfoManager.js +139 -139
- package/dist/cjs/voucher/handler.d.ts +68 -68
- package/dist/cjs/voucher/handler.js +134 -134
- package/dist/cjs/voucher/index.d.ts +2 -2
- package/dist/cjs/voucher/index.js +28 -28
- package/dist/cjs/voucher/interface.d.ts +21 -21
- package/dist/cjs/voucher/interface.js +140 -140
- package/dist/cjs/voucher/mixin.d.ts +67 -67
- package/dist/cjs/voucher/mixin.js +166 -166
- package/dist/esm/accounts/handler.d.ts +63 -63
- package/dist/esm/accounts/handler.js +91 -91
- package/dist/esm/accounts/index.d.ts +8 -8
- package/dist/esm/accounts/index.js +8 -8
- package/dist/esm/accounts/interface.d.ts +38 -38
- package/dist/esm/accounts/interface.js +111 -111
- package/dist/esm/accounts/mixin.d.ts +222 -222
- package/dist/esm/accounts/mixin.js +416 -416
- package/dist/esm/accounts/subgraph.d.ts +17 -17
- package/dist/esm/accounts/subgraph.d.ts.map +1 -1
- package/dist/esm/accounts/subgraph.js +99 -99
- package/dist/esm/accounts/types.d.ts +28 -28
- package/dist/esm/accounts/types.d.ts.map +1 -1
- package/dist/esm/accounts/types.js +1 -1
- package/dist/esm/core-sdk.d.ts +55 -55
- package/dist/esm/core-sdk.js +97 -97
- package/dist/esm/disputes/handler.d.ts +71 -71
- package/dist/esm/disputes/handler.js +82 -82
- package/dist/esm/disputes/index.d.ts +3 -3
- package/dist/esm/disputes/index.js +3 -3
- package/dist/esm/disputes/interface.d.ts +28 -28
- package/dist/esm/disputes/interface.js +59 -59
- package/dist/esm/disputes/mixin.d.ts +117 -117
- package/dist/esm/disputes/mixin.js +172 -172
- package/dist/esm/disputes/subgraph.d.ts +5 -5
- package/dist/esm/disputes/subgraph.d.ts.map +1 -1
- package/dist/esm/disputes/subgraph.js +14 -14
- package/dist/esm/erc1155/handler.d.ts +8 -8
- package/dist/esm/erc1155/handler.js +12 -12
- package/dist/esm/erc1155/index.d.ts +2 -2
- package/dist/esm/erc1155/index.js +2 -2
- package/dist/esm/erc1155/interface.d.ts +2 -2
- package/dist/esm/erc1155/interface.js +3 -3
- package/dist/esm/erc1155/mixin.d.ts +5 -5
- package/dist/esm/erc1155/mixin.js +10 -10
- package/dist/esm/erc20/handler.d.ts +38 -38
- package/dist/esm/erc20/handler.js +55 -55
- package/dist/esm/erc20/index.d.ts +3 -3
- package/dist/esm/erc20/index.js +3 -3
- package/dist/esm/erc20/interface.d.ts +2 -2
- package/dist/esm/erc20/interface.js +3 -3
- package/dist/esm/erc20/mixin.d.ts +11 -11
- package/dist/esm/erc20/mixin.js +28 -28
- package/dist/esm/erc20/subgraph.d.ts +4 -4
- package/dist/esm/erc20/subgraph.d.ts.map +1 -1
- package/dist/esm/erc20/subgraph.js +14 -14
- package/dist/esm/erc721/handler.d.ts +18 -18
- package/dist/esm/erc721/handler.js +29 -29
- package/dist/esm/erc721/index.d.ts +2 -2
- package/dist/esm/erc721/index.js +2 -2
- package/dist/esm/erc721/interface.d.ts +2 -2
- package/dist/esm/erc721/interface.js +3 -3
- package/dist/esm/erc721/mixin.d.ts +7 -7
- package/dist/esm/erc721/mixin.js +16 -16
- package/dist/esm/event-logs/index.d.ts +1 -1
- package/dist/esm/event-logs/index.js +1 -1
- package/dist/esm/event-logs/mixin.d.ts +10 -10
- package/dist/esm/event-logs/mixin.js +12 -12
- package/dist/esm/event-logs/subgraph.d.ts +2 -2
- package/dist/esm/event-logs/subgraph.js +6 -6
- package/dist/esm/exchanges/getExchangeState.d.ts +8 -8
- package/dist/esm/exchanges/getExchangeState.d.ts.map +1 -1
- package/dist/esm/exchanges/getExchangeState.js +17 -17
- package/dist/esm/exchanges/handler.d.ts +30 -30
- package/dist/esm/exchanges/handler.d.ts.map +1 -1
- package/dist/esm/exchanges/handler.js +168 -168
- package/dist/esm/exchanges/index.d.ts +4 -4
- package/dist/esm/exchanges/index.js +4 -4
- package/dist/esm/exchanges/interface.d.ts +10 -10
- package/dist/esm/exchanges/interface.js +39 -39
- package/dist/esm/exchanges/mixin.d.ts +76 -76
- package/dist/esm/exchanges/mixin.js +140 -140
- package/dist/esm/exchanges/subgraph.d.ts +5 -5
- package/dist/esm/exchanges/subgraph.d.ts.map +1 -1
- package/dist/esm/exchanges/subgraph.js +14 -14
- package/dist/esm/forwarder/biconomy-interface.d.ts +71 -71
- package/dist/esm/forwarder/biconomy-interface.d.ts.map +1 -1
- package/dist/esm/forwarder/biconomy-interface.js +23 -23
- package/dist/esm/forwarder/handler.d.ts +18 -18
- package/dist/esm/forwarder/handler.js +35 -35
- package/dist/esm/forwarder/index.d.ts +3 -3
- package/dist/esm/forwarder/index.js +3 -3
- package/dist/esm/forwarder/mock-interface.d.ts +40 -40
- package/dist/esm/forwarder/mock-interface.d.ts.map +1 -1
- package/dist/esm/forwarder/mock-interface.js +10 -10
- package/dist/esm/funds/handler.d.ts +22 -22
- package/dist/esm/funds/handler.js +43 -43
- package/dist/esm/funds/index.d.ts +3 -3
- package/dist/esm/funds/index.js +3 -3
- package/dist/esm/funds/interface.d.ts +5 -5
- package/dist/esm/funds/interface.js +17 -17
- package/dist/esm/funds/mixin.d.ts +41 -41
- package/dist/esm/funds/mixin.js +71 -71
- package/dist/esm/funds/subgraph.d.ts +5 -5
- package/dist/esm/funds/subgraph.d.ts.map +1 -1
- package/dist/esm/funds/subgraph.js +14 -14
- package/dist/esm/groups/handler.d.ts +6 -6
- package/dist/esm/groups/handler.js +7 -7
- package/dist/esm/groups/index.d.ts +3 -3
- package/dist/esm/groups/index.js +3 -3
- package/dist/esm/groups/interface.d.ts +5 -5
- package/dist/esm/groups/interface.js +23 -23
- package/dist/esm/groups/mixin.d.ts +13 -13
- package/dist/esm/groups/mixin.js +17 -17
- package/dist/esm/groups/subgraph.d.ts +1 -1
- package/dist/esm/groups/subgraph.js +1 -1
- package/dist/esm/index.d.ts +17 -17
- package/dist/esm/index.js +17 -17
- package/dist/esm/meta-tx/biconomy.d.ts +59 -59
- package/dist/esm/meta-tx/biconomy.d.ts.map +1 -1
- package/dist/esm/meta-tx/biconomy.js +89 -89
- package/dist/esm/meta-tx/handler.d.ts +230 -230
- package/dist/esm/meta-tx/handler.d.ts.map +1 -1
- package/dist/esm/meta-tx/handler.js +733 -733
- package/dist/esm/meta-tx/index.d.ts +2 -2
- package/dist/esm/meta-tx/index.js +2 -2
- package/dist/esm/meta-tx/interface.d.ts +2 -2
- package/dist/esm/meta-tx/interface.js +3 -3
- package/dist/esm/meta-tx/mixin.d.ts +219 -219
- package/dist/esm/meta-tx/mixin.js +568 -568
- package/dist/esm/metadata/index.d.ts +1 -1
- package/dist/esm/metadata/index.js +1 -1
- package/dist/esm/metadata/mixin.d.ts +41 -41
- package/dist/esm/metadata/mixin.js +59 -59
- package/dist/esm/metadata/subgraph.d.ts +20 -20
- package/dist/esm/metadata/subgraph.d.ts.map +1 -1
- package/dist/esm/metadata/subgraph.js +86 -86
- package/dist/esm/mixins/base-core-sdk.d.ts +44 -44
- package/dist/esm/mixins/base-core-sdk.js +57 -57
- package/dist/esm/native-meta-tx/handler.d.ts +42 -42
- package/dist/esm/native-meta-tx/handler.js +121 -121
- package/dist/esm/native-meta-tx/index.d.ts +2 -2
- package/dist/esm/native-meta-tx/index.js +2 -2
- package/dist/esm/native-meta-tx/interface.d.ts +3 -3
- package/dist/esm/native-meta-tx/interface.js +26 -26
- package/dist/esm/native-meta-tx/mixin.d.ts +34 -34
- package/dist/esm/native-meta-tx/mixin.js +50 -50
- package/dist/esm/native-meta-tx/tokenSpecifics.d.ts +6 -6
- package/dist/esm/native-meta-tx/tokenSpecifics.d.ts.map +1 -1
- package/dist/esm/native-meta-tx/tokenSpecifics.js +15 -15
- package/dist/esm/offers/checkExchangePolicy.d.ts +48 -48
- package/dist/esm/offers/checkExchangePolicy.d.ts.map +1 -1
- package/dist/esm/offers/checkExchangePolicy.js +19 -19
- package/dist/esm/offers/getOfferStatus.d.ts +8 -8
- package/dist/esm/offers/getOfferStatus.js +21 -21
- package/dist/esm/offers/handler.d.ts +51 -51
- package/dist/esm/offers/handler.js +118 -118
- package/dist/esm/offers/index.d.ts +12 -12
- package/dist/esm/offers/index.js +12 -12
- package/dist/esm/offers/interface.d.ts +18 -18
- package/dist/esm/offers/interface.js +75 -75
- package/dist/esm/offers/mixin.d.ts +170 -170
- package/dist/esm/offers/mixin.js +338 -338
- package/dist/esm/offers/renderContractualAgreement.d.ts +53 -53
- package/dist/esm/offers/renderContractualAgreement.d.ts.map +1 -1
- package/dist/esm/offers/renderContractualAgreement.js +208 -208
- package/dist/esm/offers/storage.d.ts +12 -12
- package/dist/esm/offers/storage.js +14 -14
- package/dist/esm/offers/subgraph.d.ts +5 -5
- package/dist/esm/offers/subgraph.d.ts.map +1 -1
- package/dist/esm/offers/subgraph.js +16 -16
- package/dist/esm/offers/types.d.ts +1 -1
- package/dist/esm/offers/types.js +1 -1
- package/dist/esm/orchestration/handler.d.ts +73 -73
- package/dist/esm/orchestration/handler.js +110 -110
- package/dist/esm/orchestration/index.d.ts +2 -2
- package/dist/esm/orchestration/index.js +2 -2
- package/dist/esm/orchestration/interface.d.ts +14 -14
- package/dist/esm/orchestration/interface.js +103 -103
- package/dist/esm/orchestration/mixin.d.ts +84 -84
- package/dist/esm/orchestration/mixin.js +136 -136
- package/dist/esm/seaport/abi.d.ts +40 -40
- package/dist/esm/seaport/abi.js +149 -149
- package/dist/esm/seaport/handler.d.ts +45 -45
- package/dist/esm/seaport/handler.d.ts.map +1 -1
- package/dist/esm/seaport/handler.js +23 -23
- package/dist/esm/seaport/index.d.ts +1 -1
- package/dist/esm/seaport/index.js +1 -1
- package/dist/esm/subgraph.d.ts +33033 -33033
- package/dist/esm/subgraph.d.ts.map +1 -1
- package/dist/esm/subgraph.js +854 -854
- package/dist/esm/utils/errors.d.ts +4 -4
- package/dist/esm/utils/errors.js +7 -7
- package/dist/esm/utils/graphql.d.ts +315 -315
- package/dist/esm/utils/graphql.js +6 -6
- package/dist/esm/utils/logs.d.ts +20 -20
- package/dist/esm/utils/logs.js +47 -47
- package/dist/esm/utils/signature.d.ts +23 -23
- package/dist/esm/utils/signature.d.ts.map +1 -1
- package/dist/esm/utils/signature.js +57 -57
- package/dist/esm/utils/tokenInfoManager.d.ts +23 -23
- package/dist/esm/utils/tokenInfoManager.js +125 -125
- package/dist/esm/voucher/handler.d.ts +68 -68
- package/dist/esm/voucher/handler.js +86 -86
- package/dist/esm/voucher/index.d.ts +2 -2
- package/dist/esm/voucher/index.js +2 -2
- package/dist/esm/voucher/interface.d.ts +21 -21
- package/dist/esm/voucher/interface.js +119 -119
- package/dist/esm/voucher/mixin.d.ts +67 -67
- package/dist/esm/voucher/mixin.js +135 -135
- package/package.json +10 -6
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { abis } from "@bosonprotocol/common";
|
|
2
|
-
import { Interface } from "@ethersproject/abi";
|
|
3
|
-
export const bosonExchangeHandlerIface = new Interface(abis.IBosonExchangeHandlerABI);
|
|
4
|
-
export function encodeCommitToOffer(buyer, offerId) {
|
|
5
|
-
return bosonExchangeHandlerIface.encodeFunctionData("commitToOffer", [
|
|
6
|
-
buyer,
|
|
7
|
-
offerId
|
|
8
|
-
]);
|
|
9
|
-
}
|
|
10
|
-
export function encodeCompleteExchange(exchangeId) {
|
|
11
|
-
return bosonExchangeHandlerIface.encodeFunctionData("completeExchange", [
|
|
12
|
-
exchangeId
|
|
13
|
-
]);
|
|
14
|
-
}
|
|
15
|
-
export function encodeCompleteExchangeBatch(exchangeIds) {
|
|
16
|
-
return bosonExchangeHandlerIface.encodeFunctionData("completeExchangeBatch", [
|
|
17
|
-
exchangeIds
|
|
18
|
-
]);
|
|
19
|
-
}
|
|
20
|
-
export function encodeRevokeVoucher(exchangeId) {
|
|
21
|
-
return bosonExchangeHandlerIface.encodeFunctionData("revokeVoucher", [
|
|
22
|
-
exchangeId
|
|
23
|
-
]);
|
|
24
|
-
}
|
|
25
|
-
export function encodeCancelVoucher(exchangeId) {
|
|
26
|
-
return bosonExchangeHandlerIface.encodeFunctionData("cancelVoucher", [
|
|
27
|
-
exchangeId
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
export function encodeExpireVoucher(exchangeId) {
|
|
31
|
-
return bosonExchangeHandlerIface.encodeFunctionData("expireVoucher", [
|
|
32
|
-
exchangeId
|
|
33
|
-
]);
|
|
34
|
-
}
|
|
35
|
-
export function encodeRedeemVoucher(exchangeId) {
|
|
36
|
-
return bosonExchangeHandlerIface.encodeFunctionData("redeemVoucher", [
|
|
37
|
-
exchangeId
|
|
38
|
-
]);
|
|
39
|
-
}
|
|
1
|
+
import { abis } from "@bosonprotocol/common";
|
|
2
|
+
import { Interface } from "@ethersproject/abi";
|
|
3
|
+
export const bosonExchangeHandlerIface = new Interface(abis.IBosonExchangeHandlerABI);
|
|
4
|
+
export function encodeCommitToOffer(buyer, offerId) {
|
|
5
|
+
return bosonExchangeHandlerIface.encodeFunctionData("commitToOffer", [
|
|
6
|
+
buyer,
|
|
7
|
+
offerId
|
|
8
|
+
]);
|
|
9
|
+
}
|
|
10
|
+
export function encodeCompleteExchange(exchangeId) {
|
|
11
|
+
return bosonExchangeHandlerIface.encodeFunctionData("completeExchange", [
|
|
12
|
+
exchangeId
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
15
|
+
export function encodeCompleteExchangeBatch(exchangeIds) {
|
|
16
|
+
return bosonExchangeHandlerIface.encodeFunctionData("completeExchangeBatch", [
|
|
17
|
+
exchangeIds
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
export function encodeRevokeVoucher(exchangeId) {
|
|
21
|
+
return bosonExchangeHandlerIface.encodeFunctionData("revokeVoucher", [
|
|
22
|
+
exchangeId
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
export function encodeCancelVoucher(exchangeId) {
|
|
26
|
+
return bosonExchangeHandlerIface.encodeFunctionData("cancelVoucher", [
|
|
27
|
+
exchangeId
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
export function encodeExpireVoucher(exchangeId) {
|
|
31
|
+
return bosonExchangeHandlerIface.encodeFunctionData("expireVoucher", [
|
|
32
|
+
exchangeId
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
export function encodeRedeemVoucher(exchangeId) {
|
|
36
|
+
return bosonExchangeHandlerIface.encodeFunctionData("redeemVoucher", [
|
|
37
|
+
exchangeId
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
40
|
//# sourceMappingURL=interface.js.map
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { BaseCoreSDK } from "./../mixins/base-core-sdk";
|
|
2
|
-
import * as subgraph from "../subgraph";
|
|
3
|
-
import { TransactionResponse, Log } from "@bosonprotocol/common";
|
|
4
|
-
import { BigNumberish } from "@ethersproject/bignumber";
|
|
5
|
-
export declare class ExchangesMixin extends BaseCoreSDK {
|
|
6
|
-
/**
|
|
7
|
-
* Returns exchange entity from subgraph.
|
|
8
|
-
* @param exchangeId - ID of exchange entity.
|
|
9
|
-
* @param queryVars - Optional query variables to skip, order or filter.
|
|
10
|
-
* @returns Exchange entity from subgraph.
|
|
11
|
-
*/
|
|
12
|
-
getExchangeById(exchangeId: BigNumberish, queryVars?: subgraph.GetExchangeByIdQueryQueryVariables): Promise<subgraph.ExchangeFieldsFragment>;
|
|
13
|
-
/**
|
|
14
|
-
* Returns exchange entities from subgraph.
|
|
15
|
-
* @param queryVars - Optional query variables to skip, order or filter.
|
|
16
|
-
* @returns Exchange entities from subgraph.
|
|
17
|
-
*/
|
|
18
|
-
getExchanges(queryVars?: subgraph.GetExchangesQueryQueryVariables): Promise<subgraph.ExchangeFieldsFragment[]>;
|
|
19
|
-
/**
|
|
20
|
-
* Commits to an offer by calling the `ExchangeHandlerContract`.
|
|
21
|
-
* This transaction only succeeds if the seller has deposited funds.
|
|
22
|
-
* @param offerId - ID of offer to commit to.
|
|
23
|
-
* @param overrides - Optional overrides.
|
|
24
|
-
* @returns Transaction response.
|
|
25
|
-
*/
|
|
26
|
-
commitToOffer(offerId: BigNumberish, overrides?: Partial<{
|
|
27
|
-
buyer: string;
|
|
28
|
-
}>): Promise<TransactionResponse>;
|
|
29
|
-
/**
|
|
30
|
-
* Utility method to retrieve the created `exchangeId` from logs after calling `commitToOffer`.
|
|
31
|
-
* @param logs - Logs to search in.
|
|
32
|
-
* @returns Created exchange id.
|
|
33
|
-
*/
|
|
34
|
-
getCommittedExchangeIdFromLogs(logs: Log[]): string | null;
|
|
35
|
-
/**
|
|
36
|
-
* Revokes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
37
|
-
* Callable by seller `assistant`.
|
|
38
|
-
* @param exchangeId - ID of exchange to revoke.
|
|
39
|
-
* @returns Transaction response.
|
|
40
|
-
*/
|
|
41
|
-
revokeVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* Cancels an existing voucher by calling the `ExchangeHandlerContract`.
|
|
44
|
-
* Callable by buyer.
|
|
45
|
-
* @param exchangeId - ID of exchange to cancel.
|
|
46
|
-
* @returns Transaction response.
|
|
47
|
-
*/
|
|
48
|
-
cancelVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
49
|
-
/**
|
|
50
|
-
* Redeems an existing voucher by calling the `ExchangeHandlerContract`.
|
|
51
|
-
* Callable by buyer.
|
|
52
|
-
* @param exchangeId - ID of exchange to redeem.
|
|
53
|
-
* @returns Transaction response.
|
|
54
|
-
*/
|
|
55
|
-
redeemVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
56
|
-
/**
|
|
57
|
-
* Completes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
58
|
-
* Callable by buyer or seller assistant.
|
|
59
|
-
* @param exchangeId - ID of exchange to complete.
|
|
60
|
-
* @returns Transaction response.
|
|
61
|
-
*/
|
|
62
|
-
completeExchange(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
63
|
-
/**
|
|
64
|
-
* Completes a batch of existing vouchers by calling the `ExchangeHandlerContract`.
|
|
65
|
-
* Callable by buyer or seller assistant.
|
|
66
|
-
* @param exchangeIds - IDs of exchange to complete.
|
|
67
|
-
* @returns Transaction response.
|
|
68
|
-
*/
|
|
69
|
-
completeExchangeBatch(exchangeIds: BigNumberish[]): Promise<TransactionResponse>;
|
|
70
|
-
/**
|
|
71
|
-
* Expires an existing voucher by calling the `ExchangeHandlerContract`.
|
|
72
|
-
* @param exchangeId - ID of exchange to expire.
|
|
73
|
-
* @returns Transaction response.
|
|
74
|
-
*/
|
|
75
|
-
expireVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
76
|
-
}
|
|
1
|
+
import { BaseCoreSDK } from "./../mixins/base-core-sdk";
|
|
2
|
+
import * as subgraph from "../subgraph";
|
|
3
|
+
import { TransactionResponse, Log } from "@bosonprotocol/common";
|
|
4
|
+
import { BigNumberish } from "@ethersproject/bignumber";
|
|
5
|
+
export declare class ExchangesMixin extends BaseCoreSDK {
|
|
6
|
+
/**
|
|
7
|
+
* Returns exchange entity from subgraph.
|
|
8
|
+
* @param exchangeId - ID of exchange entity.
|
|
9
|
+
* @param queryVars - Optional query variables to skip, order or filter.
|
|
10
|
+
* @returns Exchange entity from subgraph.
|
|
11
|
+
*/
|
|
12
|
+
getExchangeById(exchangeId: BigNumberish, queryVars?: subgraph.GetExchangeByIdQueryQueryVariables): Promise<subgraph.ExchangeFieldsFragment>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns exchange entities from subgraph.
|
|
15
|
+
* @param queryVars - Optional query variables to skip, order or filter.
|
|
16
|
+
* @returns Exchange entities from subgraph.
|
|
17
|
+
*/
|
|
18
|
+
getExchanges(queryVars?: subgraph.GetExchangesQueryQueryVariables): Promise<subgraph.ExchangeFieldsFragment[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Commits to an offer by calling the `ExchangeHandlerContract`.
|
|
21
|
+
* This transaction only succeeds if the seller has deposited funds.
|
|
22
|
+
* @param offerId - ID of offer to commit to.
|
|
23
|
+
* @param overrides - Optional overrides.
|
|
24
|
+
* @returns Transaction response.
|
|
25
|
+
*/
|
|
26
|
+
commitToOffer(offerId: BigNumberish, overrides?: Partial<{
|
|
27
|
+
buyer: string;
|
|
28
|
+
}>): Promise<TransactionResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Utility method to retrieve the created `exchangeId` from logs after calling `commitToOffer`.
|
|
31
|
+
* @param logs - Logs to search in.
|
|
32
|
+
* @returns Created exchange id.
|
|
33
|
+
*/
|
|
34
|
+
getCommittedExchangeIdFromLogs(logs: Log[]): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Revokes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
37
|
+
* Callable by seller `assistant`.
|
|
38
|
+
* @param exchangeId - ID of exchange to revoke.
|
|
39
|
+
* @returns Transaction response.
|
|
40
|
+
*/
|
|
41
|
+
revokeVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Cancels an existing voucher by calling the `ExchangeHandlerContract`.
|
|
44
|
+
* Callable by buyer.
|
|
45
|
+
* @param exchangeId - ID of exchange to cancel.
|
|
46
|
+
* @returns Transaction response.
|
|
47
|
+
*/
|
|
48
|
+
cancelVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Redeems an existing voucher by calling the `ExchangeHandlerContract`.
|
|
51
|
+
* Callable by buyer.
|
|
52
|
+
* @param exchangeId - ID of exchange to redeem.
|
|
53
|
+
* @returns Transaction response.
|
|
54
|
+
*/
|
|
55
|
+
redeemVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Completes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
58
|
+
* Callable by buyer or seller assistant.
|
|
59
|
+
* @param exchangeId - ID of exchange to complete.
|
|
60
|
+
* @returns Transaction response.
|
|
61
|
+
*/
|
|
62
|
+
completeExchange(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Completes a batch of existing vouchers by calling the `ExchangeHandlerContract`.
|
|
65
|
+
* Callable by buyer or seller assistant.
|
|
66
|
+
* @param exchangeIds - IDs of exchange to complete.
|
|
67
|
+
* @returns Transaction response.
|
|
68
|
+
*/
|
|
69
|
+
completeExchangeBatch(exchangeIds: BigNumberish[]): Promise<TransactionResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Expires an existing voucher by calling the `ExchangeHandlerContract`.
|
|
72
|
+
* @param exchangeId - ID of exchange to expire.
|
|
73
|
+
* @returns Transaction response.
|
|
74
|
+
*/
|
|
75
|
+
expireVoucher(exchangeId: BigNumberish): Promise<TransactionResponse>;
|
|
76
|
+
}
|
|
77
77
|
//# sourceMappingURL=mixin.d.ts.map
|
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
import { BaseCoreSDK } from "./../mixins/base-core-sdk";
|
|
2
|
-
import { getValueFromLogs } from "../utils/logs";
|
|
3
|
-
import { commitToOffer, revokeVoucher, cancelVoucher, redeemVoucher, completeExchange, completeExchangeBatch, expireVoucher } from "./handler";
|
|
4
|
-
import { getExchangeById, getExchanges } from "./subgraph";
|
|
5
|
-
import { bosonExchangeHandlerIface } from "./interface";
|
|
6
|
-
export class ExchangesMixin extends BaseCoreSDK {
|
|
7
|
-
/* -------------------------------------------------------------------------- */
|
|
8
|
-
/* Exchange related methods */
|
|
9
|
-
/* -------------------------------------------------------------------------- */
|
|
10
|
-
/**
|
|
11
|
-
* Returns exchange entity from subgraph.
|
|
12
|
-
* @param exchangeId - ID of exchange entity.
|
|
13
|
-
* @param queryVars - Optional query variables to skip, order or filter.
|
|
14
|
-
* @returns Exchange entity from subgraph.
|
|
15
|
-
*/
|
|
16
|
-
async getExchangeById(exchangeId, queryVars) {
|
|
17
|
-
return getExchangeById(this._subgraphUrl, exchangeId, queryVars);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Returns exchange entities from subgraph.
|
|
21
|
-
* @param queryVars - Optional query variables to skip, order or filter.
|
|
22
|
-
* @returns Exchange entities from subgraph.
|
|
23
|
-
*/
|
|
24
|
-
async getExchanges(queryVars) {
|
|
25
|
-
return getExchanges(this._subgraphUrl, queryVars);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Commits to an offer by calling the `ExchangeHandlerContract`.
|
|
29
|
-
* This transaction only succeeds if the seller has deposited funds.
|
|
30
|
-
* @param offerId - ID of offer to commit to.
|
|
31
|
-
* @param overrides - Optional overrides.
|
|
32
|
-
* @returns Transaction response.
|
|
33
|
-
*/
|
|
34
|
-
async commitToOffer(offerId, overrides = {}) {
|
|
35
|
-
const buyer = overrides.buyer || (await this._web3Lib.getSignerAddress());
|
|
36
|
-
return commitToOffer({
|
|
37
|
-
buyer,
|
|
38
|
-
offerId,
|
|
39
|
-
web3Lib: this._web3Lib,
|
|
40
|
-
subgraphUrl: this._subgraphUrl,
|
|
41
|
-
contractAddress: this._protocolDiamond
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Utility method to retrieve the created `exchangeId` from logs after calling `commitToOffer`.
|
|
46
|
-
* @param logs - Logs to search in.
|
|
47
|
-
* @returns Created exchange id.
|
|
48
|
-
*/
|
|
49
|
-
getCommittedExchangeIdFromLogs(logs) {
|
|
50
|
-
return getValueFromLogs({
|
|
51
|
-
iface: bosonExchangeHandlerIface,
|
|
52
|
-
logs,
|
|
53
|
-
eventArgsKey: "exchangeId",
|
|
54
|
-
eventName: "BuyerCommitted"
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Revokes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
59
|
-
* Callable by seller `assistant`.
|
|
60
|
-
* @param exchangeId - ID of exchange to revoke.
|
|
61
|
-
* @returns Transaction response.
|
|
62
|
-
*/
|
|
63
|
-
async revokeVoucher(exchangeId) {
|
|
64
|
-
return revokeVoucher({
|
|
65
|
-
web3Lib: this._web3Lib,
|
|
66
|
-
contractAddress: this._protocolDiamond,
|
|
67
|
-
exchangeId,
|
|
68
|
-
subgraphUrl: this._subgraphUrl
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Cancels an existing voucher by calling the `ExchangeHandlerContract`.
|
|
73
|
-
* Callable by buyer.
|
|
74
|
-
* @param exchangeId - ID of exchange to cancel.
|
|
75
|
-
* @returns Transaction response.
|
|
76
|
-
*/
|
|
77
|
-
async cancelVoucher(exchangeId) {
|
|
78
|
-
return cancelVoucher({
|
|
79
|
-
web3Lib: this._web3Lib,
|
|
80
|
-
contractAddress: this._protocolDiamond,
|
|
81
|
-
exchangeId,
|
|
82
|
-
subgraphUrl: this._subgraphUrl
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Redeems an existing voucher by calling the `ExchangeHandlerContract`.
|
|
87
|
-
* Callable by buyer.
|
|
88
|
-
* @param exchangeId - ID of exchange to redeem.
|
|
89
|
-
* @returns Transaction response.
|
|
90
|
-
*/
|
|
91
|
-
async redeemVoucher(exchangeId) {
|
|
92
|
-
return redeemVoucher({
|
|
93
|
-
web3Lib: this._web3Lib,
|
|
94
|
-
contractAddress: this._protocolDiamond,
|
|
95
|
-
exchangeId,
|
|
96
|
-
subgraphUrl: this._subgraphUrl
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Completes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
101
|
-
* Callable by buyer or seller assistant.
|
|
102
|
-
* @param exchangeId - ID of exchange to complete.
|
|
103
|
-
* @returns Transaction response.
|
|
104
|
-
*/
|
|
105
|
-
async completeExchange(exchangeId) {
|
|
106
|
-
return completeExchange({
|
|
107
|
-
web3Lib: this._web3Lib,
|
|
108
|
-
contractAddress: this._protocolDiamond,
|
|
109
|
-
exchangeId,
|
|
110
|
-
subgraphUrl: this._subgraphUrl
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Completes a batch of existing vouchers by calling the `ExchangeHandlerContract`.
|
|
115
|
-
* Callable by buyer or seller assistant.
|
|
116
|
-
* @param exchangeIds - IDs of exchange to complete.
|
|
117
|
-
* @returns Transaction response.
|
|
118
|
-
*/
|
|
119
|
-
async completeExchangeBatch(exchangeIds) {
|
|
120
|
-
return completeExchangeBatch({
|
|
121
|
-
web3Lib: this._web3Lib,
|
|
122
|
-
contractAddress: this._protocolDiamond,
|
|
123
|
-
exchangeIds,
|
|
124
|
-
subgraphUrl: this._subgraphUrl
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Expires an existing voucher by calling the `ExchangeHandlerContract`.
|
|
129
|
-
* @param exchangeId - ID of exchange to expire.
|
|
130
|
-
* @returns Transaction response.
|
|
131
|
-
*/
|
|
132
|
-
async expireVoucher(exchangeId) {
|
|
133
|
-
return expireVoucher({
|
|
134
|
-
web3Lib: this._web3Lib,
|
|
135
|
-
contractAddress: this._protocolDiamond,
|
|
136
|
-
exchangeId,
|
|
137
|
-
subgraphUrl: this._subgraphUrl
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
1
|
+
import { BaseCoreSDK } from "./../mixins/base-core-sdk";
|
|
2
|
+
import { getValueFromLogs } from "../utils/logs";
|
|
3
|
+
import { commitToOffer, revokeVoucher, cancelVoucher, redeemVoucher, completeExchange, completeExchangeBatch, expireVoucher } from "./handler";
|
|
4
|
+
import { getExchangeById, getExchanges } from "./subgraph";
|
|
5
|
+
import { bosonExchangeHandlerIface } from "./interface";
|
|
6
|
+
export class ExchangesMixin extends BaseCoreSDK {
|
|
7
|
+
/* -------------------------------------------------------------------------- */
|
|
8
|
+
/* Exchange related methods */
|
|
9
|
+
/* -------------------------------------------------------------------------- */
|
|
10
|
+
/**
|
|
11
|
+
* Returns exchange entity from subgraph.
|
|
12
|
+
* @param exchangeId - ID of exchange entity.
|
|
13
|
+
* @param queryVars - Optional query variables to skip, order or filter.
|
|
14
|
+
* @returns Exchange entity from subgraph.
|
|
15
|
+
*/
|
|
16
|
+
async getExchangeById(exchangeId, queryVars) {
|
|
17
|
+
return getExchangeById(this._subgraphUrl, exchangeId, queryVars);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns exchange entities from subgraph.
|
|
21
|
+
* @param queryVars - Optional query variables to skip, order or filter.
|
|
22
|
+
* @returns Exchange entities from subgraph.
|
|
23
|
+
*/
|
|
24
|
+
async getExchanges(queryVars) {
|
|
25
|
+
return getExchanges(this._subgraphUrl, queryVars);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Commits to an offer by calling the `ExchangeHandlerContract`.
|
|
29
|
+
* This transaction only succeeds if the seller has deposited funds.
|
|
30
|
+
* @param offerId - ID of offer to commit to.
|
|
31
|
+
* @param overrides - Optional overrides.
|
|
32
|
+
* @returns Transaction response.
|
|
33
|
+
*/
|
|
34
|
+
async commitToOffer(offerId, overrides = {}) {
|
|
35
|
+
const buyer = overrides.buyer || (await this._web3Lib.getSignerAddress());
|
|
36
|
+
return commitToOffer({
|
|
37
|
+
buyer,
|
|
38
|
+
offerId,
|
|
39
|
+
web3Lib: this._web3Lib,
|
|
40
|
+
subgraphUrl: this._subgraphUrl,
|
|
41
|
+
contractAddress: this._protocolDiamond
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Utility method to retrieve the created `exchangeId` from logs after calling `commitToOffer`.
|
|
46
|
+
* @param logs - Logs to search in.
|
|
47
|
+
* @returns Created exchange id.
|
|
48
|
+
*/
|
|
49
|
+
getCommittedExchangeIdFromLogs(logs) {
|
|
50
|
+
return getValueFromLogs({
|
|
51
|
+
iface: bosonExchangeHandlerIface,
|
|
52
|
+
logs,
|
|
53
|
+
eventArgsKey: "exchangeId",
|
|
54
|
+
eventName: "BuyerCommitted"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Revokes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
59
|
+
* Callable by seller `assistant`.
|
|
60
|
+
* @param exchangeId - ID of exchange to revoke.
|
|
61
|
+
* @returns Transaction response.
|
|
62
|
+
*/
|
|
63
|
+
async revokeVoucher(exchangeId) {
|
|
64
|
+
return revokeVoucher({
|
|
65
|
+
web3Lib: this._web3Lib,
|
|
66
|
+
contractAddress: this._protocolDiamond,
|
|
67
|
+
exchangeId,
|
|
68
|
+
subgraphUrl: this._subgraphUrl
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Cancels an existing voucher by calling the `ExchangeHandlerContract`.
|
|
73
|
+
* Callable by buyer.
|
|
74
|
+
* @param exchangeId - ID of exchange to cancel.
|
|
75
|
+
* @returns Transaction response.
|
|
76
|
+
*/
|
|
77
|
+
async cancelVoucher(exchangeId) {
|
|
78
|
+
return cancelVoucher({
|
|
79
|
+
web3Lib: this._web3Lib,
|
|
80
|
+
contractAddress: this._protocolDiamond,
|
|
81
|
+
exchangeId,
|
|
82
|
+
subgraphUrl: this._subgraphUrl
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Redeems an existing voucher by calling the `ExchangeHandlerContract`.
|
|
87
|
+
* Callable by buyer.
|
|
88
|
+
* @param exchangeId - ID of exchange to redeem.
|
|
89
|
+
* @returns Transaction response.
|
|
90
|
+
*/
|
|
91
|
+
async redeemVoucher(exchangeId) {
|
|
92
|
+
return redeemVoucher({
|
|
93
|
+
web3Lib: this._web3Lib,
|
|
94
|
+
contractAddress: this._protocolDiamond,
|
|
95
|
+
exchangeId,
|
|
96
|
+
subgraphUrl: this._subgraphUrl
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Completes an existing voucher by calling the `ExchangeHandlerContract`.
|
|
101
|
+
* Callable by buyer or seller assistant.
|
|
102
|
+
* @param exchangeId - ID of exchange to complete.
|
|
103
|
+
* @returns Transaction response.
|
|
104
|
+
*/
|
|
105
|
+
async completeExchange(exchangeId) {
|
|
106
|
+
return completeExchange({
|
|
107
|
+
web3Lib: this._web3Lib,
|
|
108
|
+
contractAddress: this._protocolDiamond,
|
|
109
|
+
exchangeId,
|
|
110
|
+
subgraphUrl: this._subgraphUrl
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Completes a batch of existing vouchers by calling the `ExchangeHandlerContract`.
|
|
115
|
+
* Callable by buyer or seller assistant.
|
|
116
|
+
* @param exchangeIds - IDs of exchange to complete.
|
|
117
|
+
* @returns Transaction response.
|
|
118
|
+
*/
|
|
119
|
+
async completeExchangeBatch(exchangeIds) {
|
|
120
|
+
return completeExchangeBatch({
|
|
121
|
+
web3Lib: this._web3Lib,
|
|
122
|
+
contractAddress: this._protocolDiamond,
|
|
123
|
+
exchangeIds,
|
|
124
|
+
subgraphUrl: this._subgraphUrl
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Expires an existing voucher by calling the `ExchangeHandlerContract`.
|
|
129
|
+
* @param exchangeId - ID of exchange to expire.
|
|
130
|
+
* @returns Transaction response.
|
|
131
|
+
*/
|
|
132
|
+
async expireVoucher(exchangeId) {
|
|
133
|
+
return expireVoucher({
|
|
134
|
+
web3Lib: this._web3Lib,
|
|
135
|
+
contractAddress: this._protocolDiamond,
|
|
136
|
+
exchangeId,
|
|
137
|
+
subgraphUrl: this._subgraphUrl
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
141
|
//# sourceMappingURL=mixin.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExchangeFieldsFragment, GetExchangesQueryQueryVariables, GetExchangeByIdQueryQueryVariables } from "../subgraph";
|
|
2
|
-
import { BigNumberish } from "@ethersproject/bignumber";
|
|
3
|
-
export
|
|
4
|
-
export declare function getExchanges(subgraphUrl: string, queryVars?: GetExchangesQueryQueryVariables): Promise<ExchangeFieldsFragment[]>;
|
|
5
|
-
export declare function getExchangeById(subgraphUrl: string, exchangeId: BigNumberish, queryVars?: SingleExchangeQueryVariables): Promise<ExchangeFieldsFragment>;
|
|
1
|
+
import { ExchangeFieldsFragment, GetExchangesQueryQueryVariables, GetExchangeByIdQueryQueryVariables } from "../subgraph";
|
|
2
|
+
import { BigNumberish } from "@ethersproject/bignumber";
|
|
3
|
+
export type SingleExchangeQueryVariables = Omit<GetExchangeByIdQueryQueryVariables, "exchangeId">;
|
|
4
|
+
export declare function getExchanges(subgraphUrl: string, queryVars?: GetExchangesQueryQueryVariables): Promise<ExchangeFieldsFragment[]>;
|
|
5
|
+
export declare function getExchangeById(subgraphUrl: string, exchangeId: BigNumberish, queryVars?: SingleExchangeQueryVariables): Promise<ExchangeFieldsFragment>;
|
|
6
6
|
//# sourceMappingURL=subgraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subgraph.d.ts","sourceRoot":"","sources":["../../../src/exchanges/subgraph.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,kCAAkC,EACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"subgraph.d.ts","sourceRoot":"","sources":["../../../src/exchanges/subgraph.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,kCAAkC,EACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,kCAAkC,EAClC,YAAY,CACb,CAAC;AAEF,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,+BAAoC,GAC9C,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAInC;AAED,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,YAAY,EACxB,SAAS,GAAE,4BAAiC,GAC3C,OAAO,CAAC,sBAAsB,CAAC,CAQjC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getSubgraphSdk } from "../utils/graphql";
|
|
2
|
-
export async function getExchanges(subgraphUrl, queryVars = {}) {
|
|
3
|
-
const sdk = getSubgraphSdk(subgraphUrl);
|
|
4
|
-
const { exchanges = [] } = await sdk.getExchangesQuery(queryVars);
|
|
5
|
-
return exchanges;
|
|
6
|
-
}
|
|
7
|
-
export async function getExchangeById(subgraphUrl, exchangeId, queryVars = {}) {
|
|
8
|
-
const sdk = getSubgraphSdk(subgraphUrl);
|
|
9
|
-
const { exchange } = await sdk.getExchangeByIdQuery({
|
|
10
|
-
exchangeId: exchangeId.toString(),
|
|
11
|
-
...queryVars
|
|
12
|
-
});
|
|
13
|
-
return exchange;
|
|
14
|
-
}
|
|
1
|
+
import { getSubgraphSdk } from "../utils/graphql";
|
|
2
|
+
export async function getExchanges(subgraphUrl, queryVars = {}) {
|
|
3
|
+
const sdk = getSubgraphSdk(subgraphUrl);
|
|
4
|
+
const { exchanges = [] } = await sdk.getExchangesQuery(queryVars);
|
|
5
|
+
return exchanges;
|
|
6
|
+
}
|
|
7
|
+
export async function getExchangeById(subgraphUrl, exchangeId, queryVars = {}) {
|
|
8
|
+
const sdk = getSubgraphSdk(subgraphUrl);
|
|
9
|
+
const { exchange } = await sdk.getExchangeByIdQuery({
|
|
10
|
+
exchangeId: exchangeId.toString(),
|
|
11
|
+
...queryVars
|
|
12
|
+
});
|
|
13
|
+
return exchange;
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=subgraph.js.map
|