@metamask/transaction-pay-controller 16.3.0 → 16.4.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 (148) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/TransactionPayController.cjs +9 -0
  3. package/dist/TransactionPayController.cjs.map +1 -1
  4. package/dist/TransactionPayController.d.cts +2 -1
  5. package/dist/TransactionPayController.d.cts.map +1 -1
  6. package/dist/TransactionPayController.d.mts +2 -1
  7. package/dist/TransactionPayController.d.mts.map +1 -1
  8. package/dist/TransactionPayController.mjs +9 -0
  9. package/dist/TransactionPayController.mjs.map +1 -1
  10. package/dist/actions/update-fiat-payment.cjs +29 -0
  11. package/dist/actions/update-fiat-payment.cjs.map +1 -0
  12. package/dist/actions/update-fiat-payment.d.cts +14 -0
  13. package/dist/actions/update-fiat-payment.d.cts.map +1 -0
  14. package/dist/actions/update-fiat-payment.d.mts +14 -0
  15. package/dist/actions/update-fiat-payment.d.mts.map +1 -0
  16. package/dist/actions/update-fiat-payment.mjs +25 -0
  17. package/dist/actions/update-fiat-payment.mjs.map +1 -0
  18. package/dist/actions/update-payment-token.cjs +1 -0
  19. package/dist/actions/update-payment-token.cjs.map +1 -1
  20. package/dist/actions/update-payment-token.d.cts.map +1 -1
  21. package/dist/actions/update-payment-token.d.mts.map +1 -1
  22. package/dist/actions/update-payment-token.mjs +1 -0
  23. package/dist/actions/update-payment-token.mjs.map +1 -1
  24. package/dist/constants.cjs +1 -0
  25. package/dist/constants.cjs.map +1 -1
  26. package/dist/constants.d.cts +1 -0
  27. package/dist/constants.d.cts.map +1 -1
  28. package/dist/constants.d.mts +1 -0
  29. package/dist/constants.d.mts.map +1 -1
  30. package/dist/constants.mjs +1 -0
  31. package/dist/constants.mjs.map +1 -1
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +1 -1
  34. package/dist/index.d.cts.map +1 -1
  35. package/dist/index.d.mts +1 -1
  36. package/dist/index.d.mts.map +1 -1
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/strategy/across/AcrossStrategy.cjs +28 -0
  39. package/dist/strategy/across/AcrossStrategy.cjs.map +1 -0
  40. package/dist/strategy/across/AcrossStrategy.d.cts +8 -0
  41. package/dist/strategy/across/AcrossStrategy.d.cts.map +1 -0
  42. package/dist/strategy/across/AcrossStrategy.d.mts +8 -0
  43. package/dist/strategy/across/AcrossStrategy.d.mts.map +1 -0
  44. package/dist/strategy/across/AcrossStrategy.mjs +24 -0
  45. package/dist/strategy/across/AcrossStrategy.mjs.map +1 -0
  46. package/dist/strategy/across/across-quotes.cjs +356 -0
  47. package/dist/strategy/across/across-quotes.cjs.map +1 -0
  48. package/dist/strategy/across/across-quotes.d.cts +10 -0
  49. package/dist/strategy/across/across-quotes.d.cts.map +1 -0
  50. package/dist/strategy/across/across-quotes.d.mts +10 -0
  51. package/dist/strategy/across/across-quotes.d.mts.map +1 -0
  52. package/dist/strategy/across/across-quotes.mjs +352 -0
  53. package/dist/strategy/across/across-quotes.mjs.map +1 -0
  54. package/dist/strategy/across/across-submit.cjs +241 -0
  55. package/dist/strategy/across/across-submit.cjs.map +1 -0
  56. package/dist/strategy/across/across-submit.d.cts +13 -0
  57. package/dist/strategy/across/across-submit.d.cts.map +1 -0
  58. package/dist/strategy/across/across-submit.d.mts +13 -0
  59. package/dist/strategy/across/across-submit.d.mts.map +1 -0
  60. package/dist/strategy/across/across-submit.mjs +237 -0
  61. package/dist/strategy/across/across-submit.mjs.map +1 -0
  62. package/dist/strategy/across/types.cjs +3 -0
  63. package/dist/strategy/across/types.cjs.map +1 -0
  64. package/dist/strategy/across/types.d.cts +89 -0
  65. package/dist/strategy/across/types.d.cts.map +1 -0
  66. package/dist/strategy/across/types.d.mts +89 -0
  67. package/dist/strategy/across/types.d.mts.map +1 -0
  68. package/dist/strategy/across/types.mjs +2 -0
  69. package/dist/strategy/across/types.mjs.map +1 -0
  70. package/dist/strategy/relay/RelayStrategy.cjs +5 -0
  71. package/dist/strategy/relay/RelayStrategy.cjs.map +1 -1
  72. package/dist/strategy/relay/RelayStrategy.d.cts +1 -0
  73. package/dist/strategy/relay/RelayStrategy.d.cts.map +1 -1
  74. package/dist/strategy/relay/RelayStrategy.d.mts +1 -0
  75. package/dist/strategy/relay/RelayStrategy.d.mts.map +1 -1
  76. package/dist/strategy/relay/RelayStrategy.mjs +5 -0
  77. package/dist/strategy/relay/RelayStrategy.mjs.map +1 -1
  78. package/dist/strategy/relay/gas-station.cjs +92 -0
  79. package/dist/strategy/relay/gas-station.cjs.map +1 -0
  80. package/dist/strategy/relay/gas-station.d.cts +22 -0
  81. package/dist/strategy/relay/gas-station.d.cts.map +1 -0
  82. package/dist/strategy/relay/gas-station.d.mts +22 -0
  83. package/dist/strategy/relay/gas-station.d.mts.map +1 -0
  84. package/dist/strategy/relay/gas-station.mjs +87 -0
  85. package/dist/strategy/relay/gas-station.mjs.map +1 -0
  86. package/dist/strategy/relay/relay-max-gas-station.cjs +242 -0
  87. package/dist/strategy/relay/relay-max-gas-station.cjs.map +1 -0
  88. package/dist/strategy/relay/relay-max-gas-station.d.cts +22 -0
  89. package/dist/strategy/relay/relay-max-gas-station.d.cts.map +1 -0
  90. package/dist/strategy/relay/relay-max-gas-station.d.mts +22 -0
  91. package/dist/strategy/relay/relay-max-gas-station.d.mts.map +1 -0
  92. package/dist/strategy/relay/relay-max-gas-station.mjs +238 -0
  93. package/dist/strategy/relay/relay-max-gas-station.mjs.map +1 -0
  94. package/dist/strategy/relay/relay-quotes.cjs +32 -59
  95. package/dist/strategy/relay/relay-quotes.cjs.map +1 -1
  96. package/dist/strategy/relay/relay-quotes.d.cts.map +1 -1
  97. package/dist/strategy/relay/relay-quotes.d.mts.map +1 -1
  98. package/dist/strategy/relay/relay-quotes.mjs +29 -56
  99. package/dist/strategy/relay/relay-quotes.mjs.map +1 -1
  100. package/dist/strategy/relay/types.cjs.map +1 -1
  101. package/dist/strategy/relay/types.d.cts +1 -0
  102. package/dist/strategy/relay/types.d.cts.map +1 -1
  103. package/dist/strategy/relay/types.d.mts +1 -0
  104. package/dist/strategy/relay/types.d.mts.map +1 -1
  105. package/dist/strategy/relay/types.mjs.map +1 -1
  106. package/dist/types.cjs.map +1 -1
  107. package/dist/types.d.cts +24 -1
  108. package/dist/types.d.cts.map +1 -1
  109. package/dist/types.d.mts +24 -1
  110. package/dist/types.d.mts.map +1 -1
  111. package/dist/types.mjs.map +1 -1
  112. package/dist/utils/amounts.cjs +40 -0
  113. package/dist/utils/amounts.cjs.map +1 -0
  114. package/dist/utils/amounts.d.cts +18 -0
  115. package/dist/utils/amounts.d.cts.map +1 -0
  116. package/dist/utils/amounts.d.mts +18 -0
  117. package/dist/utils/amounts.d.mts.map +1 -0
  118. package/dist/utils/amounts.mjs +35 -0
  119. package/dist/utils/amounts.mjs.map +1 -0
  120. package/dist/utils/feature-flags.cjs +45 -6
  121. package/dist/utils/feature-flags.cjs.map +1 -1
  122. package/dist/utils/feature-flags.d.cts +45 -2
  123. package/dist/utils/feature-flags.d.cts.map +1 -1
  124. package/dist/utils/feature-flags.d.mts +45 -2
  125. package/dist/utils/feature-flags.d.mts.map +1 -1
  126. package/dist/utils/feature-flags.mjs +42 -5
  127. package/dist/utils/feature-flags.mjs.map +1 -1
  128. package/dist/utils/gas.cjs +46 -1
  129. package/dist/utils/gas.cjs.map +1 -1
  130. package/dist/utils/gas.d.cts +18 -0
  131. package/dist/utils/gas.d.cts.map +1 -1
  132. package/dist/utils/gas.d.mts +18 -0
  133. package/dist/utils/gas.d.mts.map +1 -1
  134. package/dist/utils/gas.mjs +44 -0
  135. package/dist/utils/gas.mjs.map +1 -1
  136. package/dist/utils/strategy.cjs +3 -0
  137. package/dist/utils/strategy.cjs.map +1 -1
  138. package/dist/utils/strategy.d.cts.map +1 -1
  139. package/dist/utils/strategy.d.mts.map +1 -1
  140. package/dist/utils/strategy.mjs +3 -0
  141. package/dist/utils/strategy.mjs.map +1 -1
  142. package/dist/utils/totals.cjs +4 -19
  143. package/dist/utils/totals.cjs.map +1 -1
  144. package/dist/utils/totals.d.cts.map +1 -1
  145. package/dist/utils/totals.d.mts.map +1 -1
  146. package/dist/utils/totals.mjs +1 -16
  147. package/dist/utils/totals.mjs.map +1 -1
  148. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/strategy/relay/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nexport type RelayQuoteRequest = {\n amount: string;\n authorizationList?: {\n address: Hex;\n chainId: number;\n nonce: number;\n r: Hex;\n s: Hex;\n yParity: number;\n }[];\n destinationChainId: number;\n destinationCurrency: Hex;\n originChainId: number;\n originCurrency: Hex;\n recipient: Hex;\n refundTo?: Hex;\n slippageTolerance?: string;\n tradeType: 'EXACT_INPUT' | 'EXACT_OUTPUT' | 'EXPECTED_OUTPUT';\n txs?: {\n to: Hex;\n data: Hex;\n value: Hex;\n }[];\n user: Hex;\n};\n\nexport type RelayQuote = {\n details: {\n currencyIn: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n };\n currencyOut: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n timeEstimate: number;\n totalImpact: {\n usd: string;\n };\n };\n fees: {\n app?: {\n amountUsd: string;\n };\n relayer: {\n amountUsd: string;\n };\n subsidized?: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n address: Hex;\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n };\n metamask: {\n gasLimits: number[];\n };\n request: RelayQuoteRequest;\n steps: {\n id: string;\n items: {\n check: {\n endpoint: string;\n method: 'GET' | 'POST';\n };\n data: {\n chainId: number;\n data: Hex;\n from: Hex;\n gas?: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n to: Hex;\n value?: string;\n };\n status: 'complete' | 'incomplete';\n }[];\n kind: 'transaction';\n requestId: string;\n }[];\n};\n\nexport type RelayStatus =\n | 'waiting'\n | 'pending'\n | 'submitted'\n | 'success'\n | 'delayed'\n | 'refunded'\n | 'refund'\n | 'failure';\n\nexport type RelayStatusResponse = {\n status: RelayStatus;\n inTxHashes: string[];\n txHashes: string[];\n updatedAt: number;\n originChainId: number;\n destinationChainId: number;\n};\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/strategy/relay/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nexport type RelayQuoteRequest = {\n amount: string;\n authorizationList?: {\n address: Hex;\n chainId: number;\n nonce: number;\n r: Hex;\n s: Hex;\n yParity: number;\n }[];\n destinationChainId: number;\n destinationCurrency: Hex;\n originChainId: number;\n originCurrency: Hex;\n recipient: Hex;\n refundTo?: Hex;\n slippageTolerance?: string;\n tradeType: 'EXACT_INPUT' | 'EXACT_OUTPUT' | 'EXPECTED_OUTPUT';\n txs?: {\n to: Hex;\n data: Hex;\n value: Hex;\n }[];\n user: Hex;\n};\n\nexport type RelayQuote = {\n details: {\n currencyIn: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n };\n currencyOut: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n timeEstimate: number;\n totalImpact: {\n usd: string;\n };\n };\n fees: {\n app?: {\n amountUsd: string;\n };\n relayer: {\n amountUsd: string;\n };\n subsidized?: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n address: Hex;\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n };\n metamask: {\n gasLimits: number[];\n isMaxGasStation?: boolean;\n };\n request: RelayQuoteRequest;\n steps: {\n id: string;\n items: {\n check: {\n endpoint: string;\n method: 'GET' | 'POST';\n };\n data: {\n chainId: number;\n data: Hex;\n from: Hex;\n gas?: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n to: Hex;\n value?: string;\n };\n status: 'complete' | 'incomplete';\n }[];\n kind: 'transaction';\n requestId: string;\n }[];\n};\n\nexport type RelayStatus =\n | 'waiting'\n | 'pending'\n | 'submitted'\n | 'success'\n | 'delayed'\n | 'refunded'\n | 'refund'\n | 'failure';\n\nexport type RelayStatusResponse = {\n status: RelayStatus;\n inTxHashes: string[];\n txHashes: string[];\n updatedAt: number;\n originChainId: number;\n destinationChainId: number;\n};\n"]}
@@ -71,6 +71,7 @@ export type RelayQuote = {
71
71
  };
72
72
  metamask: {
73
73
  gasLimits: number[];
74
+ isMaxGasStation?: boolean;
74
75
  };
75
76
  request: RelayQuoteRequest;
76
77
  steps: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/strategy/relay/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE;QAClB,OAAO,EAAE,GAAG,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,CAAC,EAAE,GAAG,CAAC;QACP,CAAC,EAAE,GAAG,CAAC;QACP,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,GAAG,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,aAAa,GAAG,cAAc,GAAG,iBAAiB,CAAC;IAC9D,GAAG,CAAC,EAAE;QACJ,EAAE,EAAE,GAAG,CAAC;QACR,IAAI,EAAE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AAC;AAEd,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -71,6 +71,7 @@ export type RelayQuote = {
71
71
  };
72
72
  metamask: {
73
73
  gasLimits: number[];
74
+ isMaxGasStation?: boolean;
74
75
  };
75
76
  request: RelayQuoteRequest;
76
77
  steps: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/strategy/relay/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE;QAClB,OAAO,EAAE,GAAG,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,CAAC,EAAE,GAAG,CAAC;QACP,CAAC,EAAE,GAAG,CAAC;QACP,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,GAAG,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,aAAa,GAAG,cAAc,GAAG,iBAAiB,CAAC;IAC9D,GAAG,CAAC,EAAE;QACJ,EAAE,EAAE,GAAG,CAAC;QACR,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAE,GAAG,CAAC;KACZ,EAAE,CAAC;IACJ,IA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ACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/strategy/relay/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nexport type RelayQuoteRequest = {\n amount: string;\n authorizationList?: {\n address: Hex;\n chainId: number;\n nonce: number;\n r: Hex;\n s: Hex;\n yParity: number;\n }[];\n destinationChainId: number;\n destinationCurrency: Hex;\n originChainId: number;\n originCurrency: Hex;\n recipient: Hex;\n refundTo?: Hex;\n slippageTolerance?: string;\n tradeType: 'EXACT_INPUT' | 'EXACT_OUTPUT' | 'EXPECTED_OUTPUT';\n txs?: {\n to: Hex;\n data: Hex;\n value: Hex;\n }[];\n user: Hex;\n};\n\nexport type RelayQuote = {\n details: {\n currencyIn: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n };\n currencyOut: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n timeEstimate: number;\n totalImpact: {\n usd: string;\n };\n };\n fees: {\n app?: {\n amountUsd: string;\n };\n relayer: {\n amountUsd: string;\n };\n subsidized?: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n address: Hex;\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n };\n metamask: {\n gasLimits: number[];\n };\n request: RelayQuoteRequest;\n steps: {\n id: string;\n items: {\n check: {\n endpoint: string;\n method: 'GET' | 'POST';\n };\n data: {\n chainId: number;\n data: Hex;\n from: Hex;\n gas?: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n to: Hex;\n value?: string;\n };\n status: 'complete' | 'incomplete';\n }[];\n kind: 'transaction';\n requestId: string;\n }[];\n};\n\nexport type RelayStatus =\n | 'waiting'\n | 'pending'\n | 'submitted'\n | 'success'\n | 'delayed'\n | 'refunded'\n | 'refund'\n | 'failure';\n\nexport type RelayStatusResponse = {\n status: RelayStatus;\n inTxHashes: string[];\n txHashes: string[];\n updatedAt: number;\n originChainId: number;\n destinationChainId: number;\n};\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/strategy/relay/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nexport type RelayQuoteRequest = {\n amount: string;\n authorizationList?: {\n address: Hex;\n chainId: number;\n nonce: number;\n r: Hex;\n s: Hex;\n yParity: number;\n }[];\n destinationChainId: number;\n destinationCurrency: Hex;\n originChainId: number;\n originCurrency: Hex;\n recipient: Hex;\n refundTo?: Hex;\n slippageTolerance?: string;\n tradeType: 'EXACT_INPUT' | 'EXACT_OUTPUT' | 'EXPECTED_OUTPUT';\n txs?: {\n to: Hex;\n data: Hex;\n value: Hex;\n }[];\n user: Hex;\n};\n\nexport type RelayQuote = {\n details: {\n currencyIn: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n };\n currencyOut: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n timeEstimate: number;\n totalImpact: {\n usd: string;\n };\n };\n fees: {\n app?: {\n amountUsd: string;\n };\n relayer: {\n amountUsd: string;\n };\n subsidized?: {\n amount: string;\n amountFormatted: string;\n amountUsd: string;\n currency: {\n address: Hex;\n chainId: number;\n decimals: number;\n };\n minimumAmount: string;\n };\n };\n metamask: {\n gasLimits: number[];\n isMaxGasStation?: boolean;\n };\n request: RelayQuoteRequest;\n steps: {\n id: string;\n items: {\n check: {\n endpoint: string;\n method: 'GET' | 'POST';\n };\n data: {\n chainId: number;\n data: Hex;\n from: Hex;\n gas?: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n to: Hex;\n value?: string;\n };\n status: 'complete' | 'incomplete';\n }[];\n kind: 'transaction';\n requestId: string;\n }[];\n};\n\nexport type RelayStatus =\n | 'waiting'\n | 'pending'\n | 'submitted'\n | 'success'\n | 'delayed'\n | 'refunded'\n | 'refund'\n | 'failure';\n\nexport type RelayStatusResponse = {\n status: RelayStatus;\n inTxHashes: string[];\n txHashes: string[];\n updatedAt: number;\n originChainId: number;\n destinationChainId: number;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\n TransactionControllerAddTransactionAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n TransactionControllerStateChangeEvent,\n TransactionControllerUpdateTransactionAction,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Draft } from 'immer';\n\nimport type { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\n/** Action to update transaction configuration using a callback. */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `${typeof CONTROLLER_NAME}:setTransactionConfig`;\n handler: (transactionId: string, callback: TransactionConfigCallback) => void;\n};\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdatePaymentTokenAction;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Initial state of the controller. */\n state?: Partial<TransactionPayControllerState>;\n};\n\n/** State of the TransactionPayController. */\nexport type TransactionPayControllerState = {\n /** State relating to each transaction, keyed by transaction ID. */\n transactionData: Record<string, TransactionData>;\n};\n\n/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Source token used to pay for required tokens. */\nexport type TransactionPaymentToken = {\n /** Address of the payment token. */\n address: Hex;\n\n /** Balance of the payment token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the payment token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the payment token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the payment token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the payment token. */\n chainId: Hex;\n\n /** Decimals of the payment token. */\n decimals: number;\n\n /** Symbol of the payment token. */\n symbol: string;\n};\n\n/** Callback to update state for a single transaction. */\nexport type UpdateTransactionDataCallback = (\n /** ID of the transaction to update. */\n transactionId: string,\n /** Function that receives a draft of the transaction data to update. */\n fn: (data: Draft<TransactionData>) => void,\n) => void;\n\n/** Conversion rates from the native currency to other currencies. */\nexport type FiatRates = {\n /** Conversion rate for the native currency to the selected fiat currency. */\n fiatRate: string;\n\n /** Conversion rate for the native currency to USD. */\n usdRate: string;\n};\n\n/** Request for a quote to retrieve a required token. */\nexport type QuoteRequest = {\n /** Address of the user's account. */\n from: Hex;\n\n /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /** Balance of the source token in atomic format without factoring token decimals. */\n sourceBalanceRaw: string;\n\n /** Chain ID of the source token. */\n sourceChainId: Hex;\n\n /** Address of the source token. */\n sourceTokenAddress: Hex;\n\n /** Amount of the required token in atomic format without factoring token decimals. */\n sourceTokenAmount: string;\n\n /** Minimum amount required of the target token in atomic format without factoring token decimals. */\n targetAmountMinimum: string;\n\n /** Chain ID of the target token. */\n targetChainId: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Fees associated with a transaction pay quote. */\nexport type TransactionPayFees = {\n /** Whether a gas fee token is used to pay source network fees. */\n isSourceGasFeeToken?: boolean;\n\n /** Whether a gas fee token is used to pay target network fees. */\n isTargetGasFeeToken?: boolean;\n\n /** Fee charged by MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\n\n /** Amount of source token required. */\n sourceAmount: Amount;\n\n /** Name of the strategy used to retrieve the quote. */\n strategy: TransactionPayStrategy;\n\n /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to submit quotes for a transaction. */\nexport type PayStrategyExecuteRequest<OriginalRequest> = {\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalRequest>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** Chain ID of the source or payment token. */\n chainId: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (request: PayStrategyGetQuotesRequest) => boolean;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: Hex;\n}>;\n\n/** Single amount in alternate formats. */\nexport type Amount = FiatValue & {\n /** Amount in human-readable format factoring token decimals. */\n human: string;\n\n /** Amount in atomic format without factoring token decimals. */\n raw: string;\n};\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\n TransactionControllerAddTransactionAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n TransactionControllerStateChangeEvent,\n TransactionControllerUpdateTransactionAction,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Draft } from 'immer';\n\nimport type { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update fiat payment state for a transaction. */\nexport type TransactionPayControllerUpdateFiatPaymentAction = {\n type: `${typeof CONTROLLER_NAME}:updateFiatPayment`;\n handler: (request: UpdateFiatPaymentRequest) => void;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\n/** Action to update transaction configuration using a callback. */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `${typeof CONTROLLER_NAME}:setTransactionConfig`;\n handler: (transactionId: string, callback: TransactionConfigCallback) => void;\n};\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\n/** Callback to update fiat payment state. */\nexport type TransactionFiatPaymentCallback = (\n fiatPayment: TransactionFiatPayment,\n) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdateFiatPaymentAction\n | TransactionPayControllerUpdatePaymentTokenAction;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Initial state of the controller. */\n state?: Partial<TransactionPayControllerState>;\n};\n\n/** State of the TransactionPayController. */\nexport type TransactionPayControllerState = {\n /** State relating to each transaction, keyed by transaction ID. */\n transactionData: Record<string, TransactionData>;\n};\n\n/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Fiat payment method state. */\n fiatPayment?: TransactionFiatPayment;\n\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** Fiat payment state stored per transaction. */\nexport type TransactionFiatPayment = {\n /** Entered fiat amount for the selected payment method. */\n amountFiat?: string;\n\n /** Selected fiat payment method ID. */\n selectedPaymentMethodId?: string;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Source token used to pay for required tokens. */\nexport type TransactionPaymentToken = {\n /** Address of the payment token. */\n address: Hex;\n\n /** Balance of the payment token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the payment token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the payment token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the payment token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the payment token. */\n chainId: Hex;\n\n /** Decimals of the payment token. */\n decimals: number;\n\n /** Symbol of the payment token. */\n symbol: string;\n};\n\n/** Callback to update state for a single transaction. */\nexport type UpdateTransactionDataCallback = (\n /** ID of the transaction to update. */\n transactionId: string,\n /** Function that receives a draft of the transaction data to update. */\n fn: (data: Draft<TransactionData>) => void,\n) => void;\n\n/** Conversion rates from the native currency to other currencies. */\nexport type FiatRates = {\n /** Conversion rate for the native currency to the selected fiat currency. */\n fiatRate: string;\n\n /** Conversion rate for the native currency to USD. */\n usdRate: string;\n};\n\n/** Request for a quote to retrieve a required token. */\nexport type QuoteRequest = {\n /** Address of the user's account. */\n from: Hex;\n\n /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /** Balance of the source token in atomic format without factoring token decimals. */\n sourceBalanceRaw: string;\n\n /** Chain ID of the source token. */\n sourceChainId: Hex;\n\n /** Address of the source token. */\n sourceTokenAddress: Hex;\n\n /** Amount of the required token in atomic format without factoring token decimals. */\n sourceTokenAmount: string;\n\n /** Minimum amount required of the target token in atomic format without factoring token decimals. */\n targetAmountMinimum: string;\n\n /** Chain ID of the target token. */\n targetChainId: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Fees associated with a transaction pay quote. */\nexport type TransactionPayFees = {\n /** Whether a gas fee token is used to pay source network fees. */\n isSourceGasFeeToken?: boolean;\n\n /** Whether a gas fee token is used to pay target network fees. */\n isTargetGasFeeToken?: boolean;\n\n /** Fee charged by MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\n\n /** Amount of source token required. */\n sourceAmount: Amount;\n\n /** Name of the strategy used to retrieve the quote. */\n strategy: TransactionPayStrategy;\n\n /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to submit quotes for a transaction. */\nexport type PayStrategyExecuteRequest<OriginalRequest> = {\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalRequest>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** Chain ID of the source or payment token. */\n chainId: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (request: PayStrategyGetQuotesRequest) => boolean;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Request to update fiat payment state for a transaction. */\nexport type UpdateFiatPaymentRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Callback to mutate fiat payment state. */\n callback: TransactionFiatPaymentCallback;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: Hex;\n}>;\n\n/** Single amount in alternate formats. */\nexport type Amount = FiatValue & {\n /** Amount in human-readable format factoring token decimals. */\n human: string;\n\n /** Amount in atomic format without factoring token decimals. */\n raw: string;\n};\n"]}
package/dist/types.d.cts CHANGED
@@ -29,6 +29,11 @@ export type TransactionPayControllerGetStrategyAction = {
29
29
  type: `${typeof CONTROLLER_NAME}:getStrategy`;
30
30
  handler: (transaction: TransactionMeta) => TransactionPayStrategy;
31
31
  };
32
+ /** Action to update fiat payment state for a transaction. */
33
+ export type TransactionPayControllerUpdateFiatPaymentAction = {
34
+ type: `${typeof CONTROLLER_NAME}:updateFiatPayment`;
35
+ handler: (request: UpdateFiatPaymentRequest) => void;
36
+ };
32
37
  /** Action to update the payment token for a transaction. */
33
38
  export type TransactionPayControllerUpdatePaymentTokenAction = {
34
39
  type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;
@@ -60,8 +65,10 @@ export type TransactionConfig = {
60
65
  };
61
66
  /** Callback to update transaction config. */
62
67
  export type TransactionConfigCallback = (config: TransactionConfig) => void;
68
+ /** Callback to update fiat payment state. */
69
+ export type TransactionFiatPaymentCallback = (fiatPayment: TransactionFiatPayment) => void;
63
70
  export type TransactionPayControllerStateChangeEvent = ControllerStateChangeEvent<typeof CONTROLLER_NAME, TransactionPayControllerState>;
64
- export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdatePaymentTokenAction;
71
+ export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdateFiatPaymentAction | TransactionPayControllerUpdatePaymentTokenAction;
65
72
  export type TransactionPayControllerEvents = TransactionPayControllerStateChangeEvent;
66
73
  export type TransactionPayControllerMessenger = Messenger<typeof CONTROLLER_NAME, TransactionPayControllerActions | AllowedActions, TransactionPayControllerEvents | AllowedEvents>;
67
74
  /** Options for the TransactionPayController. */
@@ -84,6 +91,8 @@ export type TransactionPayControllerState = {
84
91
  };
85
92
  /** State relating to a single transaction. */
86
93
  export type TransactionData = {
94
+ /** Fiat payment method state. */
95
+ fiatPayment?: TransactionFiatPayment;
87
96
  /** Whether quotes are currently being retrieved. */
88
97
  isLoading: boolean;
89
98
  /** Whether the user has selected the maximum amount. */
@@ -119,6 +128,13 @@ export type TransactionData = {
119
128
  /** Calculated totals for the transaction. */
120
129
  totals?: TransactionPayTotals;
121
130
  };
131
+ /** Fiat payment state stored per transaction. */
132
+ export type TransactionFiatPayment = {
133
+ /** Entered fiat amount for the selected payment method. */
134
+ amountFiat?: string;
135
+ /** Selected fiat payment method ID. */
136
+ selectedPaymentMethodId?: string;
137
+ };
122
138
  /** A token required by a transaction. */
123
139
  export type TransactionPayRequiredToken = {
124
140
  /** Address of the required token. */
@@ -347,6 +363,13 @@ export type UpdatePaymentTokenRequest = {
347
363
  /** Chain ID of the new payment token. */
348
364
  chainId: Hex;
349
365
  };
366
+ /** Request to update fiat payment state for a transaction. */
367
+ export type UpdateFiatPaymentRequest = {
368
+ /** ID of the transaction to update. */
369
+ transactionId: string;
370
+ /** Callback to mutate fiat payment state. */
371
+ callback: TransactionFiatPaymentCallback;
372
+ };
350
373
  /** Callback to convert a transaction to a redeem delegation. */
351
374
  export type GetDelegationTransactionCallback = ({ transaction, }: {
352
375
  transa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AiB,EAAE,MAAM,CAAC;IAE1B,4DAA4D;IAC5D,IAAI,EAAE,kBAAkB,CAAC;IAEzB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IAErB,6CAA6C;IAC7C,YAAY,EAAE,SAAS,CAAC;IAExB,oEAAoE;IACpE,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,yBAAyB,GAAG;IACtC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IAEtB,wCAAwC;IACxC,YAAY,EAAE,GAAG,CAAC;IAElB,yCAAyC;IACzC,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,wBAAwB,GAAG;IACrC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IAEtB,6CAA6C;IAC7C,QAAQ,EAAE,8BAA8B,CAAC;CAC1C,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,gCAAgC,GAAG,CAAC,EAC9C,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;CAC9B,KAAK,OAAO,CAAC;IACZ,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,IAAI,EAAE,GAAG,CAAC;IACV,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG;IAC/B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IAEd,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
package/dist/types.d.mts CHANGED
@@ -29,6 +29,11 @@ export type TransactionPayControllerGetStrategyAction = {
29
29
  type: `${typeof CONTROLLER_NAME}:getStrategy`;
30
30
  handler: (transaction: TransactionMeta) => TransactionPayStrategy;
31
31
  };
32
+ /** Action to update fiat payment state for a transaction. */
33
+ export type TransactionPayControllerUpdateFiatPaymentAction = {
34
+ type: `${typeof CONTROLLER_NAME}:updateFiatPayment`;
35
+ handler: (request: UpdateFiatPaymentRequest) => void;
36
+ };
32
37
  /** Action to update the payment token for a transaction. */
33
38
  export type TransactionPayControllerUpdatePaymentTokenAction = {
34
39
  type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;
@@ -60,8 +65,10 @@ export type TransactionConfig = {
60
65
  };
61
66
  /** Callback to update transaction config. */
62
67
  export type TransactionConfigCallback = (config: TransactionConfig) => void;
68
+ /** Callback to update fiat payment state. */
69
+ export type TransactionFiatPaymentCallback = (fiatPayment: TransactionFiatPayment) => void;
63
70
  export type TransactionPayControllerStateChangeEvent = ControllerStateChangeEvent<typeof CONTROLLER_NAME, TransactionPayControllerState>;
64
- export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdatePaymentTokenAction;
71
+ export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdateFiatPaymentAction | TransactionPayControllerUpdatePaymentTokenAction;
65
72
  export type TransactionPayControllerEvents = TransactionPayControllerStateChangeEvent;
66
73
  export type TransactionPayControllerMessenger = Messenger<typeof CONTROLLER_NAME, TransactionPayControllerActions | AllowedActions, TransactionPayControllerEvents | AllowedEvents>;
67
74
  /** Options for the TransactionPayController. */
@@ -84,6 +91,8 @@ export type TransactionPayControllerState = {
84
91
  };
85
92
  /** State relating to a single transaction. */
86
93
  export type TransactionData = {
94
+ /** Fiat payment method state. */
95
+ fiatPayment?: TransactionFiatPayment;
87
96
  /** Whether quotes are currently being retrieved. */
88
97
  isLoading: boolean;
89
98
  /** Whether the user has selected the maximum amount. */
@@ -119,6 +128,13 @@ export type TransactionData = {
119
128
  /** Calculated totals for the transaction. */
120
129
  totals?: TransactionPayTotals;
121
130
  };
131
+ /** Fiat payment state stored per transaction. */
132
+ export type TransactionFiatPayment = {
133
+ /** Entered fiat amount for the selected payment method. */
134
+ amountFiat?: string;
135
+ /** Selected fiat payment method ID. */
136
+ selectedPaymentMethodId?: string;
137
+ };
122
138
  /** A token required by a transaction. */
123
139
  export type TransactionPayRequiredToken = {
124
140
  /** Address of the required token. */
@@ -347,6 +363,13 @@ export type UpdatePaymentTokenRequest = {
347
363
  /** Chain ID of the new payment token. */
348
364
  chainId: Hex;
349
365
  };
366
+ /** Request to update fiat payment state for a transaction. */
367
+ export type UpdateFiatPaymentRequest = {
368
+ /** ID of the transaction to update. */
369
+ transactionId: string;
370
+ /** Callback to mutate fiat payment state. */
371
+ callback: TransactionFiatPaymentCallback;
372
+ };
350
373
  /** Callback to convert a transaction to a redeem delegation. */
351
374
  export type GetDelegationTransactionCallback = ({ transaction, }: {
352
375
  transaction: TransactionMeta;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,OAAO,KAAK,EAAE,kCAAkC,EAAE,qCAAqC;AACvF,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAqC;AACnF,OAAO,KAAK,EAAE,sCAAsC,EAAE,qCAAqC;AAC3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,kCAAkC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,kCAAkC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,oCAAoC;AAC3E,OAAO,KAAK,EAAE,sCAAsC,EAAE,2CAA2C;AACjG,OAAO,KAAK,EAAE,6BAA6B,EAAE,2CAA2C;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,qCAAqC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,mDAAmD,EAAE,qCAAqC;AACxG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;CAC9B,KAAK,OAAO,CAAC;IACZ,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,IAAI,EAAE,GAAG,CAAC;IACV,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG;IAC/B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IAEd,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\n TransactionControllerAddTransactionAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n TransactionControllerStateChangeEvent,\n TransactionControllerUpdateTransactionAction,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Draft } from 'immer';\n\nimport type { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\n/** Action to update transaction configuration using a callback. */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `${typeof CONTROLLER_NAME}:setTransactionConfig`;\n handler: (transactionId: string, callback: TransactionConfigCallback) => void;\n};\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdatePaymentTokenAction;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Initial state of the controller. */\n state?: Partial<TransactionPayControllerState>;\n};\n\n/** State of the TransactionPayController. */\nexport type TransactionPayControllerState = {\n /** State relating to each transaction, keyed by transaction ID. */\n transactionData: Record<string, TransactionData>;\n};\n\n/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Source token used to pay for required tokens. */\nexport type TransactionPaymentToken = {\n /** Address of the payment token. */\n address: Hex;\n\n /** Balance of the payment token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the payment token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the payment token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the payment token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the payment token. */\n chainId: Hex;\n\n /** Decimals of the payment token. */\n decimals: number;\n\n /** Symbol of the payment token. */\n symbol: string;\n};\n\n/** Callback to update state for a single transaction. */\nexport type UpdateTransactionDataCallback = (\n /** ID of the transaction to update. */\n transactionId: string,\n /** Function that receives a draft of the transaction data to update. */\n fn: (data: Draft<TransactionData>) => void,\n) => void;\n\n/** Conversion rates from the native currency to other currencies. */\nexport type FiatRates = {\n /** Conversion rate for the native currency to the selected fiat currency. */\n fiatRate: string;\n\n /** Conversion rate for the native currency to USD. */\n usdRate: string;\n};\n\n/** Request for a quote to retrieve a required token. */\nexport type QuoteRequest = {\n /** Address of the user's account. */\n from: Hex;\n\n /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /** Balance of the source token in atomic format without factoring token decimals. */\n sourceBalanceRaw: string;\n\n /** Chain ID of the source token. */\n sourceChainId: Hex;\n\n /** Address of the source token. */\n sourceTokenAddress: Hex;\n\n /** Amount of the required token in atomic format without factoring token decimals. */\n sourceTokenAmount: string;\n\n /** Minimum amount required of the target token in atomic format without factoring token decimals. */\n targetAmountMinimum: string;\n\n /** Chain ID of the target token. */\n targetChainId: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Fees associated with a transaction pay quote. */\nexport type TransactionPayFees = {\n /** Whether a gas fee token is used to pay source network fees. */\n isSourceGasFeeToken?: boolean;\n\n /** Whether a gas fee token is used to pay target network fees. */\n isTargetGasFeeToken?: boolean;\n\n /** Fee charged by MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\n\n /** Amount of source token required. */\n sourceAmount: Amount;\n\n /** Name of the strategy used to retrieve the quote. */\n strategy: TransactionPayStrategy;\n\n /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to submit quotes for a transaction. */\nexport type PayStrategyExecuteRequest<OriginalRequest> = {\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalRequest>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** Chain ID of the source or payment token. */\n chainId: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (request: PayStrategyGetQuotesRequest) => boolean;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: Hex;\n}>;\n\n/** Single amount in alternate formats. */\nexport type Amount = FiatValue & {\n /** Amount in human-readable format factoring token decimals. */\n human: string;\n\n /** Amount in atomic format without factoring token decimals. */\n raw: string;\n};\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\n TransactionControllerAddTransactionAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n TransactionControllerStateChangeEvent,\n TransactionControllerUpdateTransactionAction,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Draft } from 'immer';\n\nimport type { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update fiat payment state for a transaction. */\nexport type TransactionPayControllerUpdateFiatPaymentAction = {\n type: `${typeof CONTROLLER_NAME}:updateFiatPayment`;\n handler: (request: UpdateFiatPaymentRequest) => void;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\n/** Action to update transaction configuration using a callback. */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `${typeof CONTROLLER_NAME}:setTransactionConfig`;\n handler: (transactionId: string, callback: TransactionConfigCallback) => void;\n};\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\n/** Callback to update fiat payment state. */\nexport type TransactionFiatPaymentCallback = (\n fiatPayment: TransactionFiatPayment,\n) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdateFiatPaymentAction\n | TransactionPayControllerUpdatePaymentTokenAction;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Initial state of the controller. */\n state?: Partial<TransactionPayControllerState>;\n};\n\n/** State of the TransactionPayController. */\nexport type TransactionPayControllerState = {\n /** State relating to each transaction, keyed by transaction ID. */\n transactionData: Record<string, TransactionData>;\n};\n\n/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Fiat payment method state. */\n fiatPayment?: TransactionFiatPayment;\n\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** Fiat payment state stored per transaction. */\nexport type TransactionFiatPayment = {\n /** Entered fiat amount for the selected payment method. */\n amountFiat?: string;\n\n /** Selected fiat payment method ID. */\n selectedPaymentMethodId?: string;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Source token used to pay for required tokens. */\nexport type TransactionPaymentToken = {\n /** Address of the payment token. */\n address: Hex;\n\n /** Balance of the payment token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the payment token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the payment token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the payment token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the payment token. */\n chainId: Hex;\n\n /** Decimals of the payment token. */\n decimals: number;\n\n /** Symbol of the payment token. */\n symbol: string;\n};\n\n/** Callback to update state for a single transaction. */\nexport type UpdateTransactionDataCallback = (\n /** ID of the transaction to update. */\n transactionId: string,\n /** Function that receives a draft of the transaction data to update. */\n fn: (data: Draft<TransactionData>) => void,\n) => void;\n\n/** Conversion rates from the native currency to other currencies. */\nexport type FiatRates = {\n /** Conversion rate for the native currency to the selected fiat currency. */\n fiatRate: string;\n\n /** Conversion rate for the native currency to USD. */\n usdRate: string;\n};\n\n/** Request for a quote to retrieve a required token. */\nexport type QuoteRequest = {\n /** Address of the user's account. */\n from: Hex;\n\n /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /** Balance of the source token in atomic format without factoring token decimals. */\n sourceBalanceRaw: string;\n\n /** Chain ID of the source token. */\n sourceChainId: Hex;\n\n /** Address of the source token. */\n sourceTokenAddress: Hex;\n\n /** Amount of the required token in atomic format without factoring token decimals. */\n sourceTokenAmount: string;\n\n /** Minimum amount required of the target token in atomic format without factoring token decimals. */\n targetAmountMinimum: string;\n\n /** Chain ID of the target token. */\n targetChainId: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** Fees associated with a transaction pay quote. */\nexport type TransactionPayFees = {\n /** Whether a gas fee token is used to pay source network fees. */\n isSourceGasFeeToken?: boolean;\n\n /** Whether a gas fee token is used to pay target network fees. */\n isTargetGasFeeToken?: boolean;\n\n /** Fee charged by MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\n\n /** Amount of source token required. */\n sourceAmount: Amount;\n\n /** Name of the strategy used to retrieve the quote. */\n strategy: TransactionPayStrategy;\n\n /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to submit quotes for a transaction. */\nexport type PayStrategyExecuteRequest<OriginalRequest> = {\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalRequest>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** Chain ID of the source or payment token. */\n chainId: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (request: PayStrategyGetQuotesRequest) => boolean;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Request to update fiat payment state for a transaction. */\nexport type UpdateFiatPaymentRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Callback to mutate fiat payment state. */\n callback: TransactionFiatPaymentCallback;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: Hex;\n}>;\n\n/** Single amount in alternate formats. */\nexport type Amount = FiatValue & {\n /** Amount in human-readable format factoring token decimals. */\n human: string;\n\n /** Amount in atomic format without factoring token decimals. */\n raw: string;\n};\n"]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFiatValueFromUsd = exports.sumAmounts = void 0;
4
+ const bignumber_js_1 = require("bignumber.js");
5
+ /**
6
+ * Sum a list of amounts.
7
+ *
8
+ * @param amounts - List of amounts.
9
+ * @returns Total amount.
10
+ */
11
+ function sumAmounts(amounts) {
12
+ return amounts.reduce((total, amount) => ({
13
+ fiat: new bignumber_js_1.BigNumber(total.fiat).plus(amount.fiat).toString(10),
14
+ human: new bignumber_js_1.BigNumber(total.human).plus(amount.human).toString(10),
15
+ raw: new bignumber_js_1.BigNumber(total.raw).plus(amount.raw).toString(10),
16
+ usd: new bignumber_js_1.BigNumber(total.usd).plus(amount.usd).toString(10),
17
+ }), {
18
+ fiat: '0',
19
+ human: '0',
20
+ raw: '0',
21
+ usd: '0',
22
+ });
23
+ }
24
+ exports.sumAmounts = sumAmounts;
25
+ /**
26
+ * Converts USD value to fiat value.
27
+ *
28
+ * @param usdValue - USD value.
29
+ * @param usdToFiatRate - USD to fiat rate.
30
+ * @returns Fiat value.
31
+ */
32
+ function getFiatValueFromUsd(usdValue, usdToFiatRate) {
33
+ const fiatValue = usdValue.multipliedBy(usdToFiatRate);
34
+ return {
35
+ usd: usdValue.toString(10),
36
+ fiat: fiatValue.toString(10),
37
+ };
38
+ }
39
+ exports.getFiatValueFromUsd = getFiatValueFromUsd;
40
+ //# sourceMappingURL=amounts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amounts.cjs","sourceRoot":"","sources":["../../src/utils/amounts.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAIzC;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAiB;IAC1C,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAClB,IAAI,EAAE,IAAI,wBAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9D,KAAK,EAAE,IAAI,wBAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjE,GAAG,EAAE,IAAI,wBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3D,GAAG,EAAE,IAAI,wBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;KAC5D,CAAC,EACF;QACE,IAAI,EAAE,GAAG;QACT,KAAK,EAAE,GAAG;QACV,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;KACT,CACF,CAAC;AACJ,CAAC;AAfD,gCAeC;AAED;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,QAAmB,EACnB,aAAwB;IAExB,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAEvD,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;KAC7B,CAAC;AACJ,CAAC;AAVD,kDAUC","sourcesContent":["import { BigNumber } from 'bignumber.js';\n\nimport type { Amount, FiatValue } from '../types';\n\n/**\n * Sum a list of amounts.\n *\n * @param amounts - List of amounts.\n * @returns Total amount.\n */\nexport function sumAmounts(amounts: Amount[]): Amount {\n return amounts.reduce(\n (total, amount) => ({\n fiat: new BigNumber(total.fiat).plus(amount.fiat).toString(10),\n human: new BigNumber(total.human).plus(amount.human).toString(10),\n raw: new BigNumber(total.raw).plus(amount.raw).toString(10),\n usd: new BigNumber(total.usd).plus(amount.usd).toString(10),\n }),\n {\n fiat: '0',\n human: '0',\n raw: '0',\n usd: '0',\n },\n );\n}\n\n/**\n * Converts USD value to fiat value.\n *\n * @param usdValue - USD value.\n * @param usdToFiatRate - USD to fiat rate.\n * @returns Fiat value.\n */\nexport function getFiatValueFromUsd(\n usdValue: BigNumber,\n usdToFiatRate: BigNumber,\n): FiatValue {\n const fiatValue = usdValue.multipliedBy(usdToFiatRate);\n\n return {\n usd: usdValue.toString(10),\n fiat: fiatValue.toString(10),\n };\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { BigNumber } from "bignumber.js";
2
+ import type { Amount, FiatValue } from "../types.cjs";
3
+ /**
4
+ * Sum a list of amounts.
5
+ *
6
+ * @param amounts - List of amounts.
7
+ * @returns Total amount.
8
+ */
9
+ export declare function sumAmounts(amounts: Amount[]): Amount;
10
+ /**
11
+ * Converts USD value to fiat value.
12
+ *
13
+ * @param usdValue - USD value.
14
+ * @param usdToFiatRate - USD to fiat rate.
15
+ * @returns Fiat value.
16
+ */
17
+ export declare function getFiatValueFromUsd(usdValue: BigNumber, usdToFiatRate: BigNumber): FiatValue;
18
+ //# sourceMappingURL=amounts.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amounts.d.cts","sourceRoot":"","sources":["../../src/utils/amounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAiB;AAElD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAepD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,EACnB,aAAa,EAAE,SAAS,GACvB,SAAS,CAOX"}
@@ -0,0 +1,18 @@
1
+ import { BigNumber } from "bignumber.js";
2
+ import type { Amount, FiatValue } from "../types.mjs";
3
+ /**
4
+ * Sum a list of amounts.
5
+ *
6
+ * @param amounts - List of amounts.
7
+ * @returns Total amount.
8
+ */
9
+ export declare function sumAmounts(amounts: Amount[]): Amount;
10
+ /**
11
+ * Converts USD value to fiat value.
12
+ *
13
+ * @param usdValue - USD value.
14
+ * @param usdToFiatRate - USD to fiat rate.
15
+ * @returns Fiat value.
16
+ */
17
+ export declare function getFiatValueFromUsd(usdValue: BigNumber, usdToFiatRate: BigNumber): FiatValue;
18
+ //# sourceMappingURL=amounts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amounts.d.mts","sourceRoot":"","sources":["../../src/utils/amounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAiB;AAElD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAepD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,EACnB,aAAa,EAAE,SAAS,GACvB,SAAS,CAOX"}