@metamask-previews/transaction-pay-controller 10.6.0-preview-cb897e9 → 10.6.0-preview-8a4f4ea3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/TransactionPayController.cjs +9 -1
- package/dist/TransactionPayController.cjs.map +1 -1
- package/dist/TransactionPayController.d.cts +1 -0
- package/dist/TransactionPayController.d.cts.map +1 -1
- package/dist/TransactionPayController.d.mts +1 -0
- package/dist/TransactionPayController.d.mts.map +1 -1
- package/dist/TransactionPayController.mjs +9 -1
- package/dist/TransactionPayController.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/strategy/bridge/bridge-quotes.cjs +1 -0
- package/dist/strategy/bridge/bridge-quotes.cjs.map +1 -1
- package/dist/strategy/bridge/bridge-quotes.mjs +1 -0
- package/dist/strategy/bridge/bridge-quotes.mjs.map +1 -1
- package/dist/strategy/relay/relay-quotes.cjs +23 -11
- package/dist/strategy/relay/relay-quotes.cjs.map +1 -1
- package/dist/strategy/relay/relay-quotes.mjs +23 -11
- package/dist/strategy/relay/relay-quotes.mjs.map +1 -1
- package/dist/strategy/relay/types.cjs.map +1 -1
- package/dist/strategy/relay/types.d.cts +2 -1
- package/dist/strategy/relay/types.d.cts.map +1 -1
- package/dist/strategy/relay/types.d.mts +2 -1
- package/dist/strategy/relay/types.d.mts.map +1 -1
- package/dist/strategy/relay/types.mjs.map +1 -1
- package/dist/strategy/test/TestStrategy.cjs +6 -0
- package/dist/strategy/test/TestStrategy.cjs.map +1 -1
- package/dist/strategy/test/TestStrategy.d.cts.map +1 -1
- package/dist/strategy/test/TestStrategy.d.mts.map +1 -1
- package/dist/strategy/test/TestStrategy.mjs +6 -0
- package/dist/strategy/test/TestStrategy.mjs.map +1 -1
- package/dist/tests/messenger-mock.d.cts +96 -0
- package/dist/tests/messenger-mock.d.cts.map +1 -1
- package/dist/tests/messenger-mock.d.mts +96 -0
- package/dist/tests/messenger-mock.d.mts.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +14 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +14 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/quotes.cjs +8 -3
- package/dist/utils/quotes.cjs.map +1 -1
- package/dist/utils/quotes.d.cts.map +1 -1
- package/dist/utils/quotes.d.mts.map +1 -1
- package/dist/utils/quotes.mjs +8 -3
- package/dist/utils/quotes.mjs.map +1 -1
- package/dist/utils/source-amounts.cjs +11 -3
- package/dist/utils/source-amounts.cjs.map +1 -1
- package/dist/utils/source-amounts.d.cts.map +1 -1
- package/dist/utils/source-amounts.d.mts.map +1 -1
- package/dist/utils/source-amounts.mjs +11 -3
- package/dist/utils/source-amounts.mjs.map +1 -1
- package/dist/utils/totals.cjs +7 -3
- package/dist/utils/totals.cjs.map +1 -1
- package/dist/utils/totals.d.cts +3 -1
- package/dist/utils/totals.d.cts.map +1 -1
- package/dist/utils/totals.d.mts +3 -1
- package/dist/utils/totals.d.mts.map +1 -1
- package/dist/utils/totals.mjs +7 -3
- package/dist/utils/totals.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestStrategy.cjs","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqD;AAErD,uCAA+C;AAC/C,6CAA6C;AAQ7C,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,eAAe,CAAC,CAAC;AAE/D,MAAa,YAAY;IAAzB;;
|
|
1
|
+
{"version":3,"file":"TestStrategy.cjs","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":";;;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;oBACb,GAAG,EAAE,MAAM;iBACZ;gBACD,QAAQ,EAAE,0BAAsB,CAAC,IAAI;aACtC;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAwC;QAExC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE3B,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAEzB,MAAM,uBAAA,IAAI,sDAAS,MAAb,IAAI,EAAU,IAAI,CAAC,CAAC;QAE1B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;IACxC,CAAC;CAKF;AArED,oCAqEC;gGAHU,EAAU;IACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { createModuleLogger } from '@metamask/utils';\n\nimport { TransactionPayStrategy } from '../..';\nimport { projectLogger } from '../../logger';\nimport type {\n PayStrategy,\n PayStrategyExecuteRequest,\n PayStrategyGetQuotesRequest,\n TransactionPayQuote,\n} from '../../types';\n\nconst log = createModuleLogger(projectLogger, 'test-strategy');\n\nexport class TestStrategy implements PayStrategy<void> {\n async getQuotes(\n request: PayStrategyGetQuotesRequest,\n ): Promise<TransactionPayQuote<void>[]> {\n const { requests } = request;\n\n log('Getting quotes', requests);\n\n await this.#timeout(5000);\n\n return [\n {\n dust: { fiat: '0.12', usd: '0.34' },\n estimatedDuration: 5,\n fees: {\n provider: { fiat: '1.23', usd: '1.23' },\n sourceNetwork: {\n estimate: {\n human: '2.34',\n fiat: '2.34',\n usd: '2.34',\n raw: '234000',\n },\n max: {\n human: '2.35',\n fiat: '2.35',\n usd: '2.35',\n raw: '235000',\n },\n },\n targetNetwork: {\n fiat: '3.45',\n usd: '3.45',\n },\n },\n original: undefined,\n request: requests[0],\n sourceAmount: {\n human: '4.56',\n fiat: '4.56',\n raw: '456000',\n usd: '4.56',\n },\n targetAmount: {\n human: '5.67',\n fiat: '5.67',\n raw: '567000',\n usd: '5.67',\n },\n strategy: TransactionPayStrategy.Test,\n },\n ];\n }\n\n async execute(\n request: PayStrategyExecuteRequest<void>,\n ): ReturnType<PayStrategy<void>['execute']> {\n const { quotes } = request;\n\n log('Executing', quotes);\n\n await this.#timeout(5000);\n\n return { transactionHash: undefined };\n }\n\n #timeout(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestStrategy.d.cts","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACpB,wBAAoB;AAIrB,qBAAa,YAAa,YAAW,WAAW,CAAC,IAAI,CAAC;;IAC9C,SAAS,CACb,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"TestStrategy.d.cts","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACpB,wBAAoB;AAIrB,qBAAa,YAAa,YAAW,WAAW,CAAC,IAAI,CAAC;;IAC9C,SAAS,CACb,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;IAmDjC,OAAO,CACX,OAAO,EAAE,yBAAyB,CAAC,IAAI,CAAC,GACvC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;CAa5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestStrategy.d.mts","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACpB,wBAAoB;AAIrB,qBAAa,YAAa,YAAW,WAAW,CAAC,IAAI,CAAC;;IAC9C,SAAS,CACb,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"TestStrategy.d.mts","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACpB,wBAAoB;AAIrB,qBAAa,YAAa,YAAW,WAAW,CAAC,IAAI,CAAC;;IAC9C,SAAS,CACb,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;IAmDjC,OAAO,CACX,OAAO,EAAE,yBAAyB,CAAC,IAAI,CAAC,GACvC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;CAa5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestStrategy.mjs","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AAErD,OAAO,EAAE,sBAAsB,EAAE,wBAAc;AAC/C,OAAO,EAAE,aAAa,EAAE,yBAAqB;AAQ7C,MAAM,GAAG,GAAG,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAE/D,MAAM,OAAO,YAAY;IAAzB;;
|
|
1
|
+
{"version":3,"file":"TestStrategy.mjs","sourceRoot":"","sources":["../../../src/strategy/test/TestStrategy.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AAErD,OAAO,EAAE,sBAAsB,EAAE,wBAAc;AAC/C,OAAO,EAAE,aAAa,E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QAAQ,EAAE,sBAAsB,CAAC,IAAI;aACtC;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAwC;QAExC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE3B,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAEzB,MAAM,uBAAA,IAAI,sDAAS,MAAb,IAAI,EAAU,IAAI,CAAC,CAAC;QAE1B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;IACxC,CAAC;CAKF;gGAHU,EAAU;IACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { createModuleLogger } from '@metamask/utils';\n\nimport { TransactionPayStrategy } from '../..';\nimport { projectLogger } from '../../logger';\nimport type {\n PayStrategy,\n PayStrategyExecuteRequest,\n PayStrategyGetQuotesRequest,\n TransactionPayQuote,\n} from '../../types';\n\nconst log = createModuleLogger(projectLogger, 'test-strategy');\n\nexport class TestStrategy implements PayStrategy<void> {\n async getQuotes(\n request: PayStrategyGetQuotesRequest,\n ): Promise<TransactionPayQuote<void>[]> {\n const { requests } = request;\n\n log('Getting quotes', requests);\n\n await this.#timeout(5000);\n\n return [\n {\n dust: { fiat: '0.12', usd: '0.34' },\n estimatedDuration: 5,\n fees: {\n provider: { fiat: '1.23', usd: '1.23' },\n sourceNetwork: {\n estimate: {\n human: '2.34',\n fiat: '2.34',\n usd: '2.34',\n raw: '234000',\n },\n max: {\n human: '2.35',\n fiat: '2.35',\n usd: '2.35',\n raw: '235000',\n },\n },\n targetNetwork: {\n fiat: '3.45',\n usd: '3.45',\n },\n },\n original: undefined,\n request: requests[0],\n sourceAmount: {\n human: '4.56',\n fiat: '4.56',\n raw: '456000',\n usd: '4.56',\n },\n targetAmount: {\n human: '5.67',\n fiat: '5.67',\n raw: '567000',\n usd: '5.67',\n },\n strategy: TransactionPayStrategy.Test,\n },\n ];\n }\n\n async execute(\n request: PayStrategyExecuteRequest<void>,\n ): ReturnType<PayStrategy<void>['execute']> {\n const { quotes } = request;\n\n log('Executing', quotes);\n\n await this.#timeout(5000);\n\n return { transactionHash: undefined };\n }\n\n #timeout(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n}\n"]}
|
|
@@ -67,6 +67,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
67
67
|
decimals: number;
|
|
68
68
|
icon?: string | null | undefined;
|
|
69
69
|
iconUrl?: string | null | undefined;
|
|
70
|
+
rwaData?: {
|
|
71
|
+
instrumentType: string;
|
|
72
|
+
ticker: string;
|
|
73
|
+
market: {
|
|
74
|
+
nextOpen: string;
|
|
75
|
+
nextClose: string;
|
|
76
|
+
};
|
|
77
|
+
nextPause: {
|
|
78
|
+
start: string;
|
|
79
|
+
end: string;
|
|
80
|
+
};
|
|
81
|
+
} | undefined;
|
|
70
82
|
};
|
|
71
83
|
destAsset: {
|
|
72
84
|
symbol: string;
|
|
@@ -77,6 +89,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
77
89
|
decimals: number;
|
|
78
90
|
icon?: string | null | undefined;
|
|
79
91
|
iconUrl?: string | null | undefined;
|
|
92
|
+
rwaData?: {
|
|
93
|
+
instrumentType: string;
|
|
94
|
+
ticker: string;
|
|
95
|
+
market: {
|
|
96
|
+
nextOpen: string;
|
|
97
|
+
nextClose: string;
|
|
98
|
+
};
|
|
99
|
+
nextPause: {
|
|
100
|
+
start: string;
|
|
101
|
+
end: string;
|
|
102
|
+
};
|
|
103
|
+
} | undefined;
|
|
80
104
|
};
|
|
81
105
|
requestId: string;
|
|
82
106
|
srcTokenAmount: string;
|
|
@@ -94,6 +118,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
94
118
|
decimals: number;
|
|
95
119
|
icon?: string | null | undefined;
|
|
96
120
|
iconUrl?: string | null | undefined;
|
|
121
|
+
rwaData?: {
|
|
122
|
+
instrumentType: string;
|
|
123
|
+
ticker: string;
|
|
124
|
+
market: {
|
|
125
|
+
nextOpen: string;
|
|
126
|
+
nextClose: string;
|
|
127
|
+
};
|
|
128
|
+
nextPause: {
|
|
129
|
+
start: string;
|
|
130
|
+
end: string;
|
|
131
|
+
};
|
|
132
|
+
} | undefined;
|
|
97
133
|
};
|
|
98
134
|
};
|
|
99
135
|
txFee?: ({
|
|
@@ -107,6 +143,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
107
143
|
decimals: number;
|
|
108
144
|
icon?: string | null | undefined;
|
|
109
145
|
iconUrl?: string | null | undefined;
|
|
146
|
+
rwaData?: {
|
|
147
|
+
instrumentType: string;
|
|
148
|
+
ticker: string;
|
|
149
|
+
market: {
|
|
150
|
+
nextOpen: string;
|
|
151
|
+
nextClose: string;
|
|
152
|
+
};
|
|
153
|
+
nextPause: {
|
|
154
|
+
start: string;
|
|
155
|
+
end: string;
|
|
156
|
+
};
|
|
157
|
+
} | undefined;
|
|
110
158
|
};
|
|
111
159
|
} & {
|
|
112
160
|
maxFeePerGas: string;
|
|
@@ -127,6 +175,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
127
175
|
decimals: number;
|
|
128
176
|
icon?: string | null | undefined;
|
|
129
177
|
iconUrl?: string | null | undefined;
|
|
178
|
+
rwaData?: {
|
|
179
|
+
instrumentType: string;
|
|
180
|
+
ticker: string;
|
|
181
|
+
market: {
|
|
182
|
+
nextOpen: string;
|
|
183
|
+
nextClose: string;
|
|
184
|
+
};
|
|
185
|
+
nextPause: {
|
|
186
|
+
start: string;
|
|
187
|
+
end: string;
|
|
188
|
+
};
|
|
189
|
+
} | undefined;
|
|
130
190
|
};
|
|
131
191
|
destAsset: {
|
|
132
192
|
symbol: string;
|
|
@@ -137,6 +197,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
137
197
|
decimals: number;
|
|
138
198
|
icon?: string | null | undefined;
|
|
139
199
|
iconUrl?: string | null | undefined;
|
|
200
|
+
rwaData?: {
|
|
201
|
+
instrumentType: string;
|
|
202
|
+
ticker: string;
|
|
203
|
+
market: {
|
|
204
|
+
nextOpen: string;
|
|
205
|
+
nextClose: string;
|
|
206
|
+
};
|
|
207
|
+
nextPause: {
|
|
208
|
+
start: string;
|
|
209
|
+
end: string;
|
|
210
|
+
};
|
|
211
|
+
} | undefined;
|
|
140
212
|
};
|
|
141
213
|
srcAmount: string;
|
|
142
214
|
destAmount: string;
|
|
@@ -159,6 +231,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
159
231
|
decimals: number;
|
|
160
232
|
icon?: string | null | undefined;
|
|
161
233
|
iconUrl?: string | null | undefined;
|
|
234
|
+
rwaData?: {
|
|
235
|
+
instrumentType: string;
|
|
236
|
+
ticker: string;
|
|
237
|
+
market: {
|
|
238
|
+
nextOpen: string;
|
|
239
|
+
nextClose: string;
|
|
240
|
+
};
|
|
241
|
+
nextPause: {
|
|
242
|
+
start: string;
|
|
243
|
+
end: string;
|
|
244
|
+
};
|
|
245
|
+
} | undefined;
|
|
162
246
|
};
|
|
163
247
|
destAsset: {
|
|
164
248
|
symbol: string;
|
|
@@ -169,6 +253,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
169
253
|
decimals: number;
|
|
170
254
|
icon?: string | null | undefined;
|
|
171
255
|
iconUrl?: string | null | undefined;
|
|
256
|
+
rwaData?: {
|
|
257
|
+
instrumentType: string;
|
|
258
|
+
ticker: string;
|
|
259
|
+
market: {
|
|
260
|
+
nextOpen: string;
|
|
261
|
+
nextClose: string;
|
|
262
|
+
};
|
|
263
|
+
nextPause: {
|
|
264
|
+
start: string;
|
|
265
|
+
end: string;
|
|
266
|
+
};
|
|
267
|
+
} | undefined;
|
|
172
268
|
};
|
|
173
269
|
srcAmount: string;
|
|
174
270
|
destAmount: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messenger-mock.d.cts","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAY5D;;;;;;GAMG;AAEH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,GACb,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO
|
|
1
|
+
{"version":3,"file":"messenger-mock.d.cts","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAY5D;;;;;;GAMG;AAEH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,GACb,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmOjC"}
|
|
@@ -67,6 +67,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
67
67
|
decimals: number;
|
|
68
68
|
icon?: string | null | undefined;
|
|
69
69
|
iconUrl?: string | null | undefined;
|
|
70
|
+
rwaData?: {
|
|
71
|
+
instrumentType: string;
|
|
72
|
+
ticker: string;
|
|
73
|
+
market: {
|
|
74
|
+
nextOpen: string;
|
|
75
|
+
nextClose: string;
|
|
76
|
+
};
|
|
77
|
+
nextPause: {
|
|
78
|
+
start: string;
|
|
79
|
+
end: string;
|
|
80
|
+
};
|
|
81
|
+
} | undefined;
|
|
70
82
|
};
|
|
71
83
|
destAsset: {
|
|
72
84
|
symbol: string;
|
|
@@ -77,6 +89,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
77
89
|
decimals: number;
|
|
78
90
|
icon?: string | null | undefined;
|
|
79
91
|
iconUrl?: string | null | undefined;
|
|
92
|
+
rwaData?: {
|
|
93
|
+
instrumentType: string;
|
|
94
|
+
ticker: string;
|
|
95
|
+
market: {
|
|
96
|
+
nextOpen: string;
|
|
97
|
+
nextClose: string;
|
|
98
|
+
};
|
|
99
|
+
nextPause: {
|
|
100
|
+
start: string;
|
|
101
|
+
end: string;
|
|
102
|
+
};
|
|
103
|
+
} | undefined;
|
|
80
104
|
};
|
|
81
105
|
requestId: string;
|
|
82
106
|
srcTokenAmount: string;
|
|
@@ -94,6 +118,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
94
118
|
decimals: number;
|
|
95
119
|
icon?: string | null | undefined;
|
|
96
120
|
iconUrl?: string | null | undefined;
|
|
121
|
+
rwaData?: {
|
|
122
|
+
instrumentType: string;
|
|
123
|
+
ticker: string;
|
|
124
|
+
market: {
|
|
125
|
+
nextOpen: string;
|
|
126
|
+
nextClose: string;
|
|
127
|
+
};
|
|
128
|
+
nextPause: {
|
|
129
|
+
start: string;
|
|
130
|
+
end: string;
|
|
131
|
+
};
|
|
132
|
+
} | undefined;
|
|
97
133
|
};
|
|
98
134
|
};
|
|
99
135
|
txFee?: ({
|
|
@@ -107,6 +143,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
107
143
|
decimals: number;
|
|
108
144
|
icon?: string | null | undefined;
|
|
109
145
|
iconUrl?: string | null | undefined;
|
|
146
|
+
rwaData?: {
|
|
147
|
+
instrumentType: string;
|
|
148
|
+
ticker: string;
|
|
149
|
+
market: {
|
|
150
|
+
nextOpen: string;
|
|
151
|
+
nextClose: string;
|
|
152
|
+
};
|
|
153
|
+
nextPause: {
|
|
154
|
+
start: string;
|
|
155
|
+
end: string;
|
|
156
|
+
};
|
|
157
|
+
} | undefined;
|
|
110
158
|
};
|
|
111
159
|
} & {
|
|
112
160
|
maxFeePerGas: string;
|
|
@@ -127,6 +175,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
127
175
|
decimals: number;
|
|
128
176
|
icon?: string | null | undefined;
|
|
129
177
|
iconUrl?: string | null | undefined;
|
|
178
|
+
rwaData?: {
|
|
179
|
+
instrumentType: string;
|
|
180
|
+
ticker: string;
|
|
181
|
+
market: {
|
|
182
|
+
nextOpen: string;
|
|
183
|
+
nextClose: string;
|
|
184
|
+
};
|
|
185
|
+
nextPause: {
|
|
186
|
+
start: string;
|
|
187
|
+
end: string;
|
|
188
|
+
};
|
|
189
|
+
} | undefined;
|
|
130
190
|
};
|
|
131
191
|
destAsset: {
|
|
132
192
|
symbol: string;
|
|
@@ -137,6 +197,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
137
197
|
decimals: number;
|
|
138
198
|
icon?: string | null | undefined;
|
|
139
199
|
iconUrl?: string | null | undefined;
|
|
200
|
+
rwaData?: {
|
|
201
|
+
instrumentType: string;
|
|
202
|
+
ticker: string;
|
|
203
|
+
market: {
|
|
204
|
+
nextOpen: string;
|
|
205
|
+
nextClose: string;
|
|
206
|
+
};
|
|
207
|
+
nextPause: {
|
|
208
|
+
start: string;
|
|
209
|
+
end: string;
|
|
210
|
+
};
|
|
211
|
+
} | undefined;
|
|
140
212
|
};
|
|
141
213
|
srcAmount: string;
|
|
142
214
|
destAmount: string;
|
|
@@ -159,6 +231,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
159
231
|
decimals: number;
|
|
160
232
|
icon?: string | null | undefined;
|
|
161
233
|
iconUrl?: string | null | undefined;
|
|
234
|
+
rwaData?: {
|
|
235
|
+
instrumentType: string;
|
|
236
|
+
ticker: string;
|
|
237
|
+
market: {
|
|
238
|
+
nextOpen: string;
|
|
239
|
+
nextClose: string;
|
|
240
|
+
};
|
|
241
|
+
nextPause: {
|
|
242
|
+
start: string;
|
|
243
|
+
end: string;
|
|
244
|
+
};
|
|
245
|
+
} | undefined;
|
|
162
246
|
};
|
|
163
247
|
destAsset: {
|
|
164
248
|
symbol: string;
|
|
@@ -169,6 +253,18 @@ export declare function getMessengerMock({ skipRegister, }?: {
|
|
|
169
253
|
decimals: number;
|
|
170
254
|
icon?: string | null | undefined;
|
|
171
255
|
iconUrl?: string | null | undefined;
|
|
256
|
+
rwaData?: {
|
|
257
|
+
instrumentType: string;
|
|
258
|
+
ticker: string;
|
|
259
|
+
market: {
|
|
260
|
+
nextOpen: string;
|
|
261
|
+
nextClose: string;
|
|
262
|
+
};
|
|
263
|
+
nextPause: {
|
|
264
|
+
start: string;
|
|
265
|
+
end: string;
|
|
266
|
+
};
|
|
267
|
+
} | undefined;
|
|
172
268
|
};
|
|
173
269
|
srcAmount: string;
|
|
174
270
|
destAmount: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messenger-mock.d.mts","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAY5D;;;;;;GAMG;AAEH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,GACb,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO
|
|
1
|
+
{"version":3,"file":"messenger-mock.d.mts","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAY5D;;;;;;GAMG;AAEH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,GACb,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmOjC"}
|
package/dist/types.cjs.map
CHANGED
|
@@ -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 { TokenListControllerActions } 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 | TokenListControllerActions\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\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\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 /** 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 /** Source token selected for the transaction. */\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 /** Address of the required 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 /** 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 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\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 /** 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 /** 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 { TokenListControllerActions } 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 | TokenListControllerActions\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 set the max amount flag for a transaction. */\nexport type TransactionPayControllerSetIsMaxAmountAction = {\n type: `${typeof CONTROLLER_NAME}:setIsMaxAmount`;\n handler: (transactionId: string, isMaxAmount: boolean) => void;\n};\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetIsMaxAmountAction\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 /** 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 /** Source token selected for the transaction. */\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 /** Address of the required 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 /** 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 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: Amount;\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 /** 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: Amount;\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"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -35,8 +35,13 @@ export type TransactionPayControllerUpdatePaymentTokenAction = {
|
|
|
35
35
|
type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;
|
|
36
36
|
handler: (request: UpdatePaymentTokenRequest) => void;
|
|
37
37
|
};
|
|
38
|
+
/** Action to set the max amount flag for a transaction. */
|
|
39
|
+
export type TransactionPayControllerSetIsMaxAmountAction = {
|
|
40
|
+
type: `${typeof CONTROLLER_NAME}:setIsMaxAmount`;
|
|
41
|
+
handler: (transactionId: string, isMaxAmount: boolean) => void;
|
|
42
|
+
};
|
|
38
43
|
export type TransactionPayControllerStateChangeEvent = ControllerStateChangeEvent<typeof CONTROLLER_NAME, TransactionPayControllerState>;
|
|
39
|
-
export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerUpdatePaymentTokenAction;
|
|
44
|
+
export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerSetIsMaxAmountAction | TransactionPayControllerUpdatePaymentTokenAction;
|
|
40
45
|
export type TransactionPayControllerEvents = TransactionPayControllerStateChangeEvent;
|
|
41
46
|
export type TransactionPayControllerMessenger = Messenger<typeof CONTROLLER_NAME, TransactionPayControllerActions | AllowedActions, TransactionPayControllerEvents | AllowedEvents>;
|
|
42
47
|
/** Options for the TransactionPayController. */
|
|
@@ -59,6 +64,8 @@ export type TransactionPayControllerState = {
|
|
|
59
64
|
export type TransactionData = {
|
|
60
65
|
/** Whether quotes are currently being retrieved. */
|
|
61
66
|
isLoading: boolean;
|
|
67
|
+
/** Whether the user has selected the maximum amount. */
|
|
68
|
+
isMaxAmount?: boolean;
|
|
62
69
|
/** Source token selected for the transaction. */
|
|
63
70
|
paymentToken?: TransactionPaymentToken;
|
|
64
71
|
/** Quotes retrieved for the transaction. */
|
|
@@ -148,6 +155,8 @@ export type FiatRates = {
|
|
|
148
155
|
export type QuoteRequest = {
|
|
149
156
|
/** Address of the user's account. */
|
|
150
157
|
from: Hex;
|
|
158
|
+
/** Whether the transaction is a maximum amount transaction. */
|
|
159
|
+
isMaxAmount?: boolean;
|
|
151
160
|
/** Balance of the source token in atomic format without factoring token decimals. */
|
|
152
161
|
sourceBalanceRaw: string;
|
|
153
162
|
/** Chain ID of the source token. */
|
|
@@ -195,6 +204,8 @@ export type TransactionPayQuote<OriginalQuote> = {
|
|
|
195
204
|
sourceAmount: Amount;
|
|
196
205
|
/** Name of the strategy used to retrieve the quote. */
|
|
197
206
|
strategy: TransactionPayStrategy;
|
|
207
|
+
/** Amount of target token provided. */
|
|
208
|
+
targetAmount: Amount;
|
|
198
209
|
};
|
|
199
210
|
/** Request to get quotes for a transaction. */
|
|
200
211
|
export type PayStrategyGetQuotesRequest = {
|
|
@@ -261,6 +272,8 @@ export type TransactionPayTotals = {
|
|
|
261
272
|
fees: TransactionPayFees;
|
|
262
273
|
/** Total amount of source token required. */
|
|
263
274
|
sourceAmount: Amount;
|
|
275
|
+
/** Total amount of target token provided. */
|
|
276
|
+
targetAmount: Amount;
|
|
264
277
|
/** Overall total cost for the target transaction and all quotes. */
|
|
265
278
|
total: FiatValue;
|
|
266
279
|
};
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,qCAAqC;AAC/E,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,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AAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -35,8 +35,13 @@ export type TransactionPayControllerUpdatePaymentTokenAction = {
|
|
|
35
35
|
type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;
|
|
36
36
|
handler: (request: UpdatePaymentTokenRequest) => void;
|
|
37
37
|
};
|
|
38
|
+
/** Action to set the max amount flag for a transaction. */
|
|
39
|
+
export type TransactionPayControllerSetIsMaxAmountAction = {
|
|
40
|
+
type: `${typeof CONTROLLER_NAME}:setIsMaxAmount`;
|
|
41
|
+
handler: (transactionId: string, isMaxAmount: boolean) => void;
|
|
42
|
+
};
|
|
38
43
|
export type TransactionPayControllerStateChangeEvent = ControllerStateChangeEvent<typeof CONTROLLER_NAME, TransactionPayControllerState>;
|
|
39
|
-
export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerUpdatePaymentTokenAction;
|
|
44
|
+
export type TransactionPayControllerActions = TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetStateAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerSetIsMaxAmountAction | TransactionPayControllerUpdatePaymentTokenAction;
|
|
40
45
|
export type TransactionPayControllerEvents = TransactionPayControllerStateChangeEvent;
|
|
41
46
|
export type TransactionPayControllerMessenger = Messenger<typeof CONTROLLER_NAME, TransactionPayControllerActions | AllowedActions, TransactionPayControllerEvents | AllowedEvents>;
|
|
42
47
|
/** Options for the TransactionPayController. */
|
|
@@ -59,6 +64,8 @@ export type TransactionPayControllerState = {
|
|
|
59
64
|
export type TransactionData = {
|
|
60
65
|
/** Whether quotes are currently being retrieved. */
|
|
61
66
|
isLoading: boolean;
|
|
67
|
+
/** Whether the user has selected the maximum amount. */
|
|
68
|
+
isMaxAmount?: boolean;
|
|
62
69
|
/** Source token selected for the transaction. */
|
|
63
70
|
paymentToken?: TransactionPaymentToken;
|
|
64
71
|
/** Quotes retrieved for the transaction. */
|
|
@@ -148,6 +155,8 @@ export type FiatRates = {
|
|
|
148
155
|
export type QuoteRequest = {
|
|
149
156
|
/** Address of the user's account. */
|
|
150
157
|
from: Hex;
|
|
158
|
+
/** Whether the transaction is a maximum amount transaction. */
|
|
159
|
+
isMaxAmount?: boolean;
|
|
151
160
|
/** Balance of the source token in atomic format without factoring token decimals. */
|
|
152
161
|
sourceBalanceRaw: string;
|
|
153
162
|
/** Chain ID of the source token. */
|
|
@@ -195,6 +204,8 @@ export type TransactionPayQuote<OriginalQuote> = {
|
|
|
195
204
|
sourceAmount: Amount;
|
|
196
205
|
/** Name of the strategy used to retrieve the quote. */
|
|
197
206
|
strategy: TransactionPayStrategy;
|
|
207
|
+
/** Amount of target token provided. */
|
|
208
|
+
targetAmount: Amount;
|
|
198
209
|
};
|
|
199
210
|
/** Request to get quotes for a transaction. */
|
|
200
211
|
export type PayStrategyGetQuotesRequest = {
|
|
@@ -261,6 +272,8 @@ export type TransactionPayTotals = {
|
|
|
261
272
|
fees: TransactionPayFees;
|
|
262
273
|
/** Total amount of source token required. */
|
|
263
274
|
sourceAmount: Amount;
|
|
275
|
+
/** Total amount of target token provided. */
|
|
276
|
+
targetAmount: Amount;
|
|
264
277
|
/** Overall total cost for the target transaction and all quotes. */
|
|
265
278
|
total: FiatValue;
|
|
266
279
|
};
|