tapimo 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/README.md +11 -2
  2. package/dist/ApiKey.d.ts +12 -11
  3. package/dist/ApiKey.d.ts.map +1 -1
  4. package/dist/ApiKey.js +10 -12
  5. package/dist/ApiKey.js.map +1 -1
  6. package/dist/ApiKeys.d.ts +139 -0
  7. package/dist/ApiKeys.d.ts.map +1 -0
  8. package/dist/ApiKeys.js +166 -0
  9. package/dist/ApiKeys.js.map +1 -0
  10. package/dist/App.d.ts +920 -910
  11. package/dist/App.d.ts.map +1 -1
  12. package/dist/App.js +36 -12
  13. package/dist/App.js.map +1 -1
  14. package/dist/Handler.d.ts +86 -0
  15. package/dist/Handler.d.ts.map +1 -0
  16. package/dist/Handler.js +83 -0
  17. package/dist/Handler.js.map +1 -0
  18. package/dist/Scope.d.ts +4 -1
  19. package/dist/Scope.d.ts.map +1 -1
  20. package/dist/Scope.js +5 -1
  21. package/dist/Scope.js.map +1 -1
  22. package/dist/Webhooks.d.ts +3 -5
  23. package/dist/Webhooks.d.ts.map +1 -1
  24. package/dist/Webhooks.js +9 -2
  25. package/dist/Webhooks.js.map +1 -1
  26. package/dist/admin/Access.d.ts +1 -3
  27. package/dist/admin/Access.d.ts.map +1 -1
  28. package/dist/admin/Access.js +1 -3
  29. package/dist/admin/Access.js.map +1 -1
  30. package/dist/admin/App.d.ts +98 -209
  31. package/dist/admin/App.d.ts.map +1 -1
  32. package/dist/admin/App.js +2 -4
  33. package/dist/admin/App.js.map +1 -1
  34. package/dist/admin/apps/api-keys.d.ts +7 -5
  35. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  36. package/dist/admin/apps/api-keys.js +8 -9
  37. package/dist/admin/apps/api-keys.js.map +1 -1
  38. package/dist/admin/apps/scopes.d.ts +3 -0
  39. package/dist/admin/apps/scopes.d.ts.map +1 -1
  40. package/dist/admin/apps/verified-tokens.d.ts +101 -215
  41. package/dist/admin/apps/verified-tokens.d.ts.map +1 -1
  42. package/dist/admin/apps/verified-tokens.js +17 -38
  43. package/dist/admin/apps/verified-tokens.js.map +1 -1
  44. package/dist/admin/ui.generated.d.ts +1 -1
  45. package/dist/admin/ui.generated.js +1 -1
  46. package/dist/apps/balances.d.ts +2 -2
  47. package/dist/apps/receipts.d.ts +43 -43
  48. package/dist/apps/tokens.d.ts +454 -454
  49. package/dist/apps/transactions.d.ts +43 -43
  50. package/dist/apps/transfers.d.ts +29 -29
  51. package/dist/apps/webhooks.d.ts +5 -2
  52. package/dist/apps/webhooks.d.ts.map +1 -1
  53. package/dist/apps/webhooks.js +38 -34
  54. package/dist/apps/webhooks.js.map +1 -1
  55. package/dist/{Cli.d.ts → cli/Cli.d.ts} +13 -2
  56. package/dist/cli/Cli.d.ts.map +1 -0
  57. package/dist/cli/Cli.js +19 -0
  58. package/dist/cli/Cli.js.map +1 -0
  59. package/dist/cli/bin.d.ts +3 -0
  60. package/dist/cli/bin.d.ts.map +1 -0
  61. package/dist/cli/bin.js +4 -0
  62. package/dist/cli/bin.js.map +1 -0
  63. package/dist/cli/commands/admin.d.ts +15 -0
  64. package/dist/cli/commands/admin.d.ts.map +1 -0
  65. package/dist/cli/commands/admin.js +60 -0
  66. package/dist/cli/commands/admin.js.map +1 -0
  67. package/dist/cloudflare.d.ts +7 -0
  68. package/dist/cloudflare.d.ts.map +1 -1
  69. package/dist/cloudflare.js +9 -0
  70. package/dist/cloudflare.js.map +1 -1
  71. package/dist/db/Db.d.ts +103 -0
  72. package/dist/db/Db.d.ts.map +1 -0
  73. package/dist/db/Db.js +274 -0
  74. package/dist/db/Db.js.map +1 -0
  75. package/dist/db/Schema.d.ts +88 -0
  76. package/dist/db/Schema.d.ts.map +1 -0
  77. package/dist/db/Schema.js +130 -0
  78. package/dist/db/Schema.js.map +1 -0
  79. package/dist/db/tables/organizations.d.ts +79 -0
  80. package/dist/db/tables/organizations.d.ts.map +1 -0
  81. package/dist/db/tables/organizations.js +81 -0
  82. package/dist/db/tables/organizations.js.map +1 -0
  83. package/dist/db/tables/verifiedTokens.d.ts +53 -0
  84. package/dist/db/tables/verifiedTokens.d.ts.map +1 -0
  85. package/dist/db/tables/verifiedTokens.js +74 -0
  86. package/dist/db/tables/verifiedTokens.js.map +1 -0
  87. package/dist/db/tables/webhookDeliveries.d.ts +71 -0
  88. package/dist/db/tables/webhookDeliveries.d.ts.map +1 -0
  89. package/dist/db/tables/webhookDeliveries.js +119 -0
  90. package/dist/db/tables/webhookDeliveries.js.map +1 -0
  91. package/dist/db/tables/webhookSubscriptions.d.ts +158 -0
  92. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -0
  93. package/dist/db/tables/webhookSubscriptions.js +272 -0
  94. package/dist/db/tables/webhookSubscriptions.js.map +1 -0
  95. package/dist/handlers/internal/executionError.d.ts +25 -0
  96. package/dist/handlers/internal/executionError.d.ts.map +1 -0
  97. package/dist/handlers/internal/executionError.js +184 -0
  98. package/dist/handlers/internal/executionError.js.map +1 -0
  99. package/dist/handlers/internal/multisig.d.ts +237 -0
  100. package/dist/handlers/internal/multisig.d.ts.map +1 -0
  101. package/dist/handlers/internal/multisig.js +567 -0
  102. package/dist/handlers/internal/multisig.js.map +1 -0
  103. package/dist/handlers/internal/requestListener.d.ts +124 -0
  104. package/dist/handlers/internal/requestListener.d.ts.map +1 -0
  105. package/dist/handlers/internal/requestListener.js +173 -0
  106. package/dist/handlers/internal/requestListener.js.map +1 -0
  107. package/dist/handlers/internal/sponsorship.d.ts +83 -0
  108. package/dist/handlers/internal/sponsorship.d.ts.map +1 -0
  109. package/dist/handlers/internal/sponsorship.js +103 -0
  110. package/dist/handlers/internal/sponsorship.js.map +1 -0
  111. package/dist/handlers/internal/types.d.ts +284 -0
  112. package/dist/handlers/internal/types.d.ts.map +1 -0
  113. package/dist/handlers/internal/types.js +2 -0
  114. package/dist/handlers/internal/types.js.map +1 -0
  115. package/dist/handlers/internal/utils.d.ts +34 -0
  116. package/dist/handlers/internal/utils.d.ts.map +1 -0
  117. package/dist/handlers/internal/utils.js +131 -0
  118. package/dist/handlers/internal/utils.js.map +1 -0
  119. package/dist/handlers/relay.d.ts +119 -0
  120. package/dist/handlers/relay.d.ts.map +1 -0
  121. package/dist/handlers/relay.js +1264 -0
  122. package/dist/handlers/relay.js.map +1 -0
  123. package/dist/index.d.ts +4 -2
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +4 -2
  126. package/dist/index.js.map +1 -1
  127. package/dist/internal/Auth.d.ts +16 -10
  128. package/dist/internal/Auth.d.ts.map +1 -1
  129. package/dist/internal/Auth.js +72 -12
  130. package/dist/internal/Auth.js.map +1 -1
  131. package/dist/internal/RpcSchema.d.ts +10 -0
  132. package/dist/internal/RpcSchema.d.ts.map +1 -0
  133. package/dist/internal/RpcSchema.js +2 -0
  134. package/dist/internal/RpcSchema.js.map +1 -0
  135. package/dist/internal/Store.d.ts +42 -3
  136. package/dist/internal/Store.d.ts.map +1 -1
  137. package/dist/internal/Store.js +65 -3
  138. package/dist/internal/Store.js.map +1 -1
  139. package/dist/internal/VerifiedTokens.d.ts +15 -34
  140. package/dist/internal/VerifiedTokens.d.ts.map +1 -1
  141. package/dist/internal/VerifiedTokens.js +115 -159
  142. package/dist/internal/VerifiedTokens.js.map +1 -1
  143. package/dist/internal/Webhooks.d.ts +49 -35
  144. package/dist/internal/Webhooks.d.ts.map +1 -1
  145. package/dist/internal/Webhooks.js +92 -205
  146. package/dist/internal/Webhooks.js.map +1 -1
  147. package/package.json +7 -2
  148. package/src/ApiKey.test.ts +3 -3
  149. package/src/ApiKey.ts +10 -12
  150. package/src/ApiKeys.test.ts +175 -0
  151. package/src/ApiKeys.ts +205 -0
  152. package/src/App.test-d.ts +1 -1
  153. package/src/App.test.ts +10768 -351
  154. package/src/App.ts +79 -36
  155. package/src/Client.test-d.ts +1 -1
  156. package/src/Handler.ts +154 -0
  157. package/src/Scope.ts +5 -1
  158. package/src/Webhooks.test.ts +8 -7
  159. package/src/Webhooks.ts +11 -5
  160. package/src/admin/Access.ts +1 -3
  161. package/src/admin/App.ts +19 -24
  162. package/src/admin/apps/api-keys.test.ts +19 -18
  163. package/src/admin/apps/api-keys.ts +8 -9
  164. package/src/admin/apps/scopes.test.ts +4 -0
  165. package/src/admin/apps/verified-tokens.test.ts +3 -30
  166. package/src/admin/apps/verified-tokens.ts +17 -36
  167. package/src/admin/ui.generated.ts +1 -1
  168. package/src/apps/balances.test.ts +4 -3
  169. package/src/apps/blocks.test.ts +1 -1
  170. package/src/apps/exchanges.test.ts +1 -1
  171. package/src/apps/indexer.test.ts +1 -1
  172. package/src/apps/receipts.test.ts +1 -1
  173. package/src/apps/rpc.test.ts +100 -10
  174. package/src/apps/tokenlist.test.ts +5 -7
  175. package/src/apps/tokens.test.ts +4 -3
  176. package/src/apps/transactions.test.ts +1 -1
  177. package/src/apps/transfers.test.ts +1 -1
  178. package/src/apps/verified-tokens.test.ts +24 -12
  179. package/src/apps/webhooks.test.ts +130 -143
  180. package/src/apps/webhooks.ts +45 -47
  181. package/src/{Cli.test.ts → cli/Cli.test.ts} +10 -9
  182. package/src/{Cli.ts → cli/Cli.ts} +16 -9
  183. package/src/cli/bin.ts +4 -0
  184. package/src/cli/commands/admin.test.ts +71 -0
  185. package/src/cli/commands/admin.ts +60 -0
  186. package/src/cloudflare.ts +10 -0
  187. package/src/db/Db.test.ts +84 -0
  188. package/src/db/Db.ts +383 -0
  189. package/src/db/Schema.ts +164 -0
  190. package/src/db/tables/organizations.test.ts +124 -0
  191. package/src/db/tables/organizations.ts +127 -0
  192. package/src/db/tables/verifiedTokens.ts +111 -0
  193. package/src/db/tables/webhookDeliveries.ts +159 -0
  194. package/src/db/tables/webhookSubscriptions.ts +358 -0
  195. package/src/handlers/internal/executionError.ts +205 -0
  196. package/src/handlers/internal/multisig.localnet.test.ts +146 -0
  197. package/src/handlers/internal/multisig.test.ts +744 -0
  198. package/src/handlers/internal/multisig.ts +858 -0
  199. package/src/handlers/internal/relay.localnet.test.ts +2035 -0
  200. package/src/handlers/internal/requestListener.ts +273 -0
  201. package/src/handlers/internal/sponsorship.ts +186 -0
  202. package/src/handlers/internal/types.ts +378 -0
  203. package/src/handlers/internal/utils.ts +153 -0
  204. package/src/handlers/relay.ts +1605 -0
  205. package/src/index.ts +4 -2
  206. package/src/internal/Auth.test.ts +21 -21
  207. package/src/internal/Auth.ts +92 -19
  208. package/src/internal/RateLimit.test.ts +1 -1
  209. package/src/internal/RpcSchema.ts +10 -0
  210. package/src/internal/Store.test.ts +98 -10
  211. package/src/internal/Store.ts +112 -6
  212. package/src/internal/VerifiedTokens.test.ts +99 -115
  213. package/src/internal/VerifiedTokens.ts +123 -175
  214. package/src/internal/Webhooks.test.ts +107 -107
  215. package/src/internal/Webhooks.ts +102 -220
  216. package/dist/ApiKeySource.d.ts +0 -166
  217. package/dist/ApiKeySource.d.ts.map +0 -1
  218. package/dist/ApiKeySource.js +0 -234
  219. package/dist/ApiKeySource.js.map +0 -1
  220. package/dist/Cli.d.ts.map +0 -1
  221. package/dist/Cli.js +0 -13
  222. package/dist/Cli.js.map +0 -1
  223. package/seeds/31318/icons/0x20c0000000000000000000000000000000000000.svg +0 -1
  224. package/seeds/31318/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
  225. package/seeds/31318/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
  226. package/seeds/31318/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
  227. package/seeds/31318/verified-tokens.json +0 -30
  228. package/seeds/4217/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
  229. package/seeds/4217/icons/0x20c000000000000000000000048c8f36df1c9a4a.svg +0 -1
  230. package/seeds/4217/icons/0x20c0000000000000000000000520792dcccccccc.svg +0 -1
  231. package/seeds/4217/icons/0x20c0000000000000000000000a6da882d075a4c3.svg +0 -4
  232. package/seeds/4217/icons/0x20c000000000000000000000111111111e910f0f.svg +0 -30
  233. package/seeds/4217/icons/0x20c00000000000000000000014f22ca97301eb73.svg +0 -1
  234. package/seeds/4217/icons/0x20c0000000000000000000001621e21f71cf12fb.svg +0 -1
  235. package/seeds/4217/icons/0x20c0000000000000000000002f52d5cc21a3207b.svg +0 -1
  236. package/seeds/4217/icons/0x20c0000000000000000000003158081efd85bfc2.svg +0 -11
  237. package/seeds/4217/icons/0x20c0000000000000000000003554d28269e0f3c2.svg +0 -1
  238. package/seeds/4217/icons/0x20c000000000000000000000383a23bacb546ab9.svg +0 -1
  239. package/seeds/4217/icons/0x20c00000000000000000000042109aef2f8b28e1.png +0 -0
  240. package/seeds/4217/icons/0x20c0000000000000000000005c0bac7cef389a11.svg +0 -1
  241. package/seeds/4217/icons/0x20c0000000000000000000006fd9a167923ba194.png +0 -0
  242. package/seeds/4217/icons/0x20c0000000000000000000007f7ba549dd0251b9.svg +0 -1
  243. package/seeds/4217/icons/0x20c0000000000000000000008191667423f70e67.svg +0 -5
  244. package/seeds/4217/icons/0x20c0000000000000000000008ee4fcff88888888.svg +0 -1
  245. package/seeds/4217/icons/0x20c0000000000000000000009a4a4b17e0dc6651.svg +0 -1
  246. package/seeds/4217/icons/0x20c000000000000000000000ab02d39df30bd17e.svg +0 -1
  247. package/seeds/4217/icons/0x20c000000000000000000000ae247a1130450f09.svg +0 -1
  248. package/seeds/4217/icons/0x20c000000000000000000000aeed2ec36a54d0e5.svg +0 -1
  249. package/seeds/4217/icons/0x20c000000000000000000000b9537d11c60e8b50.svg +0 -1
  250. package/seeds/4217/icons/0x20c000000000000000000000bd95bfb69fbe6ce3.svg +0 -1
  251. package/seeds/4217/icons/0x20c000000000000000000000c412ec89d0c08be5.svg +0 -1
  252. package/seeds/4217/icons/0x20c000000000000000000000f047dd7018e50367.png +0 -0
  253. package/seeds/4217/verified-tokens.json +0 -177
  254. package/seeds/42431/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
  255. package/seeds/42431/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
  256. package/seeds/42431/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
  257. package/seeds/42431/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
  258. package/seeds/42431/icons/0x20c0000000000000000000009e8d7eb59b783726.svg +0 -1
  259. package/seeds/42431/icons/0x20c000000000000000000000d72572838bbee59c.svg +0 -1
  260. package/seeds/42431/verified-tokens.json +0 -44
  261. package/seeds/openrpc/README.md +0 -27
  262. package/seeds/openrpc/execution-apis.json +0 -8989
  263. package/src/ApiKeySource.test-d.ts +0 -11
  264. package/src/ApiKeySource.test.ts +0 -295
  265. package/src/ApiKeySource.ts +0 -303
@@ -0,0 +1,284 @@
1
+ /** Combines members of an intersection into a readable type. */
2
+ export type Compute<type> = {
3
+ [key in keyof type]: type[key];
4
+ } & unknown;
5
+ declare const symbol: unique symbol;
6
+ /**
7
+ * Creates a branded type of `T` with the brand `U`.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * type Result = Branded<string, 'foo'>
12
+ * // ^? type Result = string & { [symbol]: 'foo' }
13
+ * ```
14
+ */
15
+ export type Branded<T, U> = T & {
16
+ [symbol]: U;
17
+ };
18
+ /**
19
+ * Filters out all members of `T` that are not `P`
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * type Result = Filter<['a', 'b', 'c'], 'b'>
24
+ * // ^? type Result = ['a', 'c']
25
+ * ```
26
+ *
27
+ * @internal
28
+ */
29
+ export type Filter<T extends readonly unknown[], P, Acc extends readonly unknown[] = []> = T extends readonly [infer F, ...infer Rest extends readonly unknown[]] ? [F] extends [P] ? Filter<Rest, P, [...Acc, F]> : Filter<Rest, P, Acc> : readonly [...Acc];
30
+ /**
31
+ * Checks if `T` can be narrowed further than `U`
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * type Result = IsNarrowable<'foo', string>
36
+ * // ^? true
37
+ * ```
38
+ */
39
+ export type IsNarrowable<T, U> = IsNever<(T extends U ? true : false) & (U extends T ? false : true)> extends true ? false : true;
40
+ /**
41
+ * Checks if `T` is `never`
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * type Result = IsNever<never>
46
+ * // ^? type Result = true
47
+ * ```
48
+ */
49
+ export type IsNever<T> = [T] extends [never] ? true : false;
50
+ /**
51
+ * Removes `readonly` from all properties of an object.
52
+ *
53
+ * @internal
54
+ */
55
+ export type Mutable<type extends object> = {
56
+ -readonly [key in keyof type]: type[key];
57
+ };
58
+ /**
59
+ * Evaluates boolean "or" condition for `T` properties.
60
+ *
61
+ * * @example
62
+ * ```ts
63
+ * type Result = Or<[false, true, false]>
64
+ * // ^? type Result = true
65
+ * ```
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * type Result = Or<[false, false, false]>
70
+ * // ^? type Result = false
71
+ * ```
72
+ *
73
+ * @internal
74
+ */
75
+ export type Or<T extends readonly unknown[]> = T extends readonly [infer Head, ...infer Tail] ? Head extends true ? true : Or<Tail> : false;
76
+ /**
77
+ * Checks if `T` is `undefined`
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * type Result = IsUndefined<undefined>
82
+ * // ^? type Result = true
83
+ * ```
84
+ *
85
+ * @internal
86
+ */
87
+ export type IsUndefined<T> = [undefined] extends [T] ? true : false;
88
+ /**
89
+ * Checks if type `T` is the `unknown` type.
90
+ *
91
+ * @internal
92
+ */
93
+ export type IsUnknown<T> = unknown extends T ? ([T] extends [null] ? false : true) : false;
94
+ /** @internal */
95
+ export type MaybePromise<T> = T | Promise<T>;
96
+ /**
97
+ * Makes attributes on the type T required if required is true.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * MaybeRequired<{ a: string, b?: number }, true>
102
+ * // { a: string, b: number }
103
+ *
104
+ * MaybeRequired<{ a: string, b?: number }, false>
105
+ * // { a: string, b?: number }
106
+ * ```
107
+ *
108
+ * @internal
109
+ */
110
+ export type MaybeRequired<T, required extends boolean> = required extends true ? ExactRequired<T> : T;
111
+ /**
112
+ * Assigns the properties of U onto T.
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * Assign<{ a: string, b: number }, { a: undefined, c: boolean }>
117
+ * // { a: undefined, b: number, c: boolean }
118
+ * ```
119
+ *
120
+ * @internal
121
+ */
122
+ export type Assign<T, U> = Assign_inner<T, U> & U;
123
+ /** @internal */
124
+ export type Assign_inner<T, U> = {
125
+ [K in keyof T as K extends keyof U ? (U[K] extends void ? never : K) : K]: K extends keyof U ? U[K] : T[K];
126
+ };
127
+ /**
128
+ * Constructs a type by excluding `undefined` from `T`.
129
+ *
130
+ * @example
131
+ * ```ts
132
+ * NoUndefined<string | undefined>
133
+ * // string
134
+ * ```
135
+ *
136
+ * @internal
137
+ */
138
+ export type NoUndefined<T> = T extends undefined ? never : T;
139
+ /**
140
+ * Strict version of built-in Omit type
141
+ *
142
+ * @internal
143
+ */
144
+ export type Omit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
145
+ /**
146
+ * Creates a type that is a partial of T, but with the required keys K.
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * PartialBy<{ a: string, b: number }, 'a'>
151
+ * // { a?: string, b: number }
152
+ * ```
153
+ *
154
+ * @internal
155
+ */
156
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & ExactPartial<Pick<T, K>>;
157
+ export type RecursiveArray<T> = T | readonly RecursiveArray<T>[];
158
+ /**
159
+ * Creates a type that is T with the required keys K.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * RequiredBy<{ a?: string, b: number }, 'a'>
164
+ * // { a: string, b: number }
165
+ * ```
166
+ *
167
+ * @internal
168
+ */
169
+ export type RequiredBy<T, K extends keyof T> = Omit<T, K> & ExactRequired<Pick<T, K>>;
170
+ /**
171
+ * Returns truthy if `array` contains `value`.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * Some<[1, 2, 3], 2>
176
+ * // true
177
+ * ```
178
+ *
179
+ * @internal
180
+ */
181
+ export type Some<array extends readonly unknown[], value> = array extends readonly [
182
+ value,
183
+ ...unknown[]
184
+ ] ? true : array extends readonly [unknown, ...infer rest] ? Some<rest, value> : false;
185
+ /**
186
+ * Prints custom error message
187
+ *
188
+ * @param messages - Error message
189
+ * @returns Custom error message
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * type Result = TypeErrorMessage<'Custom error message'>
194
+ * // ^? type Result = ['Error: Custom error message']
195
+ * ```
196
+ */
197
+ export type TypeErrorMessage<messages extends string | string[]> = messages extends string ? [
198
+ `Error: ${messages}`
199
+ ] : {
200
+ [key in keyof messages]: messages[key] extends infer message extends string ? `Error: ${message}` : never;
201
+ };
202
+ /** @internal */
203
+ export type UnionToTuple<union, last = LastInUnion<union>> = [union] extends [never] ? [] : [...UnionToTuple<Exclude<union, last>>, last];
204
+ /** @internal */
205
+ export type LastInUnion<U> = UnionToIntersection<U extends unknown ? (x: U) => 0 : never> extends (x: infer l) => 0 ? l : never;
206
+ /** @internal */
207
+ export type UnionToIntersection<union> = (union extends unknown ? (arg: union) => 0 : never) extends (arg: infer i) => 0 ? i : never;
208
+ /** @internal */
209
+ export type IsUnion<union, union2 = union> = union extends union2 ? ([union2] extends [union] ? false : true) : never;
210
+ /** @internal */
211
+ export type MaybePartial<type, enabled extends boolean | undefined> = enabled extends true ? Compute<ExactPartial<type>> : type;
212
+ export type ExactPartial<type> = {
213
+ [key in keyof type]?: type[key] | undefined;
214
+ };
215
+ /** @internal */
216
+ export type ExactRequired<type> = {
217
+ [key in keyof type]-?: Exclude<type[key], undefined>;
218
+ };
219
+ export type OneOf<union extends object, fallback extends object | undefined = undefined, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends infer item ? Compute<item & {
220
+ [key in Exclude<keys, keyof item>]?: fallback extends object ? key extends keyof fallback ? fallback[key] : undefined : undefined;
221
+ }> : never;
222
+ /** @internal */
223
+ export type KeyofUnion<type> = type extends type ? keyof type : never;
224
+ /** @internal */
225
+ export type Undefined<type> = {
226
+ [key in keyof type]?: undefined;
227
+ };
228
+ /**
229
+ * Loose version of {@link Omit}
230
+ * @internal
231
+ */
232
+ export type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;
233
+ /** @internal */
234
+ export type UnionCompute<type> = type extends object ? Compute<type> : type;
235
+ /** @internal */
236
+ export type UnionLooseOmit<type, keys extends string> = type extends any ? LooseOmit<type, keys> : never;
237
+ /**
238
+ * Construct a type with the properties of union type T except for those in type K.
239
+ * @example
240
+ * ```ts
241
+ * type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>
242
+ * // { b: number } | { b: undefined, c: number }
243
+ * ```
244
+ *
245
+ * @internal
246
+ */
247
+ export type UnionOmit<type, keys extends keyof type> = type extends any ? Omit<type, keys> : never;
248
+ /**
249
+ * Construct a type with the properties of union type T except for those in type K.
250
+ * @example
251
+ * ```ts
252
+ * type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>
253
+ * // { b: number } | { b: undefined, c: number }
254
+ * ```
255
+ *
256
+ * @internal
257
+ */
258
+ export type UnionPick<type, keys extends keyof type> = type extends any ? Pick<type, keys> : never;
259
+ /**
260
+ * Creates a type that is a partial of T, but with the required keys K.
261
+ *
262
+ * @example
263
+ * ```ts
264
+ * PartialBy<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>
265
+ * // { a?: string, b: number } | { a?: string, b: undefined, c: number }
266
+ * ```
267
+ *
268
+ * @internal
269
+ */
270
+ export type UnionPartialBy<T, K extends keyof T> = T extends any ? PartialBy<T, K> : never;
271
+ /**
272
+ * Creates a type that is T with the required keys K.
273
+ *
274
+ * @example
275
+ * ```ts
276
+ * RequiredBy<{ a?: string, b: number } | { a?: string, c?: number }, 'a'>
277
+ * // { a: string, b: number } | { a: string, c?: number }
278
+ * ```
279
+ *
280
+ * @internal
281
+ */
282
+ export type UnionRequiredBy<T, K extends keyof T> = T extends any ? RequiredBy<T, K> : never;
283
+ export {};
284
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/handlers/internal/types.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,MAAM,M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;AAKxF,gBAAgB;AAChB,MAAM,MAAM,YAAY,CAAC,IAAI,IAAI,IAAI,SAAS,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAE3E,gBAAgB;AAChB,MAAM,MAAM,cAAc,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,SAAS,GAAG,GACpE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,GACrB,KAAK,CAAA;AAET;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,IAAI,SAAS,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,KAAK,CAAA;AAElG;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,IAAI,SAAS,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,KAAK,CAAA;AAElG;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAA;AAE1F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/handlers/internal/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import { RpcRequest, RpcResponse } from 'ox';
2
+ import { Transaction as core_Transaction } from 'ox/tempo';
3
+ import { type Client } from 'viem';
4
+ import * as z from 'zod/mini';
5
+ export declare function resolveChainId(value: unknown): number | undefined;
6
+ export declare function formatFillTransactionRequest(client: Client, value: Record<string, unknown>): Record<string, unknown>;
7
+ export declare function normalizeFillTransactionRequest(tx: Record<string, unknown>): Record<string, unknown> & {
8
+ calls: unknown[];
9
+ };
10
+ /** Returns whether a raw transaction uses a Tempo sender or fee-payer wire prefix. */
11
+ export declare function isSerializedTempoTransaction(value: unknown): value is `0x76${string}` | `0x78${string}`;
12
+ export declare function normalizeTempoTransaction(value: Record<string, unknown> | undefined): core_Transaction.Transaction<false, bigint, number>;
13
+ /** Returns a raw JSON-RPC error response object (not wrapped in a `Response`). */
14
+ export declare function rpcErrorJson(request: RpcRequest.RpcRequest, error: unknown): {
15
+ readonly id: number;
16
+ readonly jsonrpc: '2.0';
17
+ readonly error: RpcResponse.InvalidParamsError;
18
+ } | {
19
+ readonly id: number;
20
+ readonly jsonrpc: '2.0';
21
+ readonly error: RpcResponse.MethodNotSupportedError;
22
+ } | {
23
+ readonly id: number;
24
+ readonly jsonrpc: '2.0';
25
+ readonly error: {
26
+ readonly code: number;
27
+ readonly message: string;
28
+ readonly data?: {};
29
+ };
30
+ };
31
+ export declare function rpcError(request: RpcRequest.RpcRequest, error: unknown): Response;
32
+ export declare function rpcResult(request: RpcRequest.RpcRequest, result: unknown): Response;
33
+ export declare const parseParams: z.ZodMiniReadonly<z.ZodMiniTuple<readonly [z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>], null>>;
34
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/handlers/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAoB,WAAW,IAAI,gBAAgB,EAAmB,MAAM,UAAU,CAAA;AAC7F,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,MAAM,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,sBAS5C;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2BAI1F;AAED,wBAAgB,+BAA+B,CAC7C,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,CAmBhD;AAoBD,sFAAsF;AACtF,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,CAO5C;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,uDAGnF;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;EA2B1E;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,YAEtE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,YAExE;AAED,eAAO,MAAM,WAAW,gHAA2D,CAAA"}
@@ -0,0 +1,131 @@
1
+ import { Hex, RpcRequest, RpcResponse } from 'ox';
2
+ import { KeyAuthorization, Transaction as core_Transaction, TxEnvelopeTempo } from 'ox/tempo';
3
+ import { BaseError } from 'viem';
4
+ import * as z from 'zod/mini';
5
+ export function resolveChainId(value) {
6
+ if (typeof value === 'number')
7
+ return value;
8
+ if (typeof value === 'bigint')
9
+ return Number(value);
10
+ if (typeof value === 'string') {
11
+ if (Hex.validate(value))
12
+ return Hex.toNumber(value);
13
+ const n = Number(value);
14
+ if (Number.isFinite(n))
15
+ return n;
16
+ }
17
+ return undefined;
18
+ }
19
+ export function formatFillTransactionRequest(client, value) {
20
+ const format = client.chain?.formatters?.transactionRequest?.format;
21
+ if (!format)
22
+ return value;
23
+ return format({ ...value }, 'fillTransaction');
24
+ }
25
+ export function normalizeFillTransactionRequest(tx) {
26
+ const { to, data, value, ...rest } = tx;
27
+ const keyAuthorization = normalizeKeyAuthorization(tx['keyAuthorization']);
28
+ const withKeyAuthorization = keyAuthorization ? { keyAuthorization } : {};
29
+ if (Array.isArray(tx['calls']) && tx['calls'].length > 0)
30
+ return {
31
+ ...tx,
32
+ ...withKeyAuthorization,
33
+ calls: tx['calls'].map((call) => ({
34
+ ...call,
35
+ value: normalizeFillValue(call.value),
36
+ })),
37
+ };
38
+ const call = {
39
+ ...(typeof to !== 'undefined' ? { to } : {}),
40
+ ...(typeof data !== 'undefined' ? { data } : {}),
41
+ ...(typeof value !== 'undefined' ? { value: normalizeFillValue(value) } : {}),
42
+ };
43
+ return { ...rest, ...withKeyAuthorization, calls: [call] };
44
+ }
45
+ /**
46
+ * Forwards `keyAuthorization` to the chain in RPC shape. Pass-through
47
+ * when already RPC; convert via `KeyAuthorization.toRpc` when internal.
48
+ */
49
+ function normalizeKeyAuthorization(value) {
50
+ if (!value || typeof value !== 'object')
51
+ return undefined;
52
+ const ka = value;
53
+ const signature = ka['signature'];
54
+ if (!signature || typeof signature !== 'object')
55
+ return undefined;
56
+ const isInternal = typeof signature['signature'] === 'object' && signature['signature'] !== null;
57
+ return isInternal ? KeyAuthorization.toRpc(value) : value;
58
+ }
59
+ function normalizeFillValue(value) {
60
+ if (typeof value !== 'string' || !value.startsWith('0x'))
61
+ return value;
62
+ return BigInt(value === '0x' ? '0x0' : value);
63
+ }
64
+ /** Returns whether a raw transaction uses a Tempo sender or fee-payer wire prefix. */
65
+ export function isSerializedTempoTransaction(value) {
66
+ if (typeof value !== 'string')
67
+ return false;
68
+ // `0x78` is Tempo's fee-payer handoff magic, not a separate EIP-2718 type.
69
+ return (value.startsWith(TxEnvelopeTempo.serializedType) ||
70
+ value.startsWith(TxEnvelopeTempo.feePayerMagic));
71
+ }
72
+ export function normalizeTempoTransaction(value) {
73
+ if (!value)
74
+ throw new Error('Expected `tx` in eth_fillTransaction response.');
75
+ return core_Transaction.fromRpc({ type: '0x76', ...value });
76
+ }
77
+ /** Returns a raw JSON-RPC error response object (not wrapped in a `Response`). */
78
+ export function rpcErrorJson(request, error) {
79
+ if (error instanceof RpcResponse.InvalidParamsError)
80
+ return RpcResponse.from({ error }, { request });
81
+ if (error instanceof RpcResponse.MethodNotSupportedError)
82
+ return RpcResponse.from({ error }, { request });
83
+ if (error.name === 'ZodError')
84
+ return RpcResponse.from({
85
+ error: new RpcResponse.InvalidParamsError({
86
+ message: error.message,
87
+ }),
88
+ }, { request });
89
+ const inner = resolveError(error);
90
+ const message = inner.message ?? error.message;
91
+ const code = inner.code ?? -32603;
92
+ const data = inner.data;
93
+ return RpcResponse.from({
94
+ error: { code, message, ...(data ? { data } : {}) },
95
+ }, { request });
96
+ }
97
+ export function rpcError(request, error) {
98
+ return Response.json(rpcErrorJson(request, error));
99
+ }
100
+ export function rpcResult(request, result) {
101
+ return Response.json(RpcResponse.from({ result }, { request }));
102
+ }
103
+ export const parseParams = z.readonly(z.tuple([z.record(z.string(), z.unknown())]));
104
+ function resolveError(error) {
105
+ if (!error || typeof error !== 'object')
106
+ return {};
107
+ // Walk the `cause` chain to the deepest object that looks like an upstream
108
+ // JSON-RPC error (`{ code, message }`). This unwraps viem's
109
+ // `RpcRequestError`, whose own `message` is the verbose
110
+ // "RPC Request failed.\nURL: …\nRequest body: …" formatting, and surfaces
111
+ // the raw upstream error instead.
112
+ let deepest;
113
+ let current = error;
114
+ const seen = new Set();
115
+ while (current && typeof current === 'object' && !seen.has(current)) {
116
+ seen.add(current);
117
+ const e = current;
118
+ if (typeof e['code'] === 'number' && typeof e['message'] === 'string')
119
+ deepest = { code: e['code'], message: e['message'], data: e['data'] };
120
+ current = e['cause'];
121
+ }
122
+ if (deepest)
123
+ return deepest;
124
+ if (error instanceof BaseError) {
125
+ const inner = error.walk((e) => typeof e['code'] === 'number');
126
+ if (inner && typeof inner['code'] === 'number' && typeof inner['message'] === 'string')
127
+ return { message: inner['message'], code: inner['code'], data: inner['data'] };
128
+ }
129
+ return {};
130
+ }
131
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/handlers/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,WAAW,IAAI,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC7F,OAAO,EAAe,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;QACvB,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,MAAc,EAAE,KAA8B;IACzF,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,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AM,CAAC,EAAE,CAAA;QACvE,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;IACtB,CAAC;IACD,IAAI,OAAO;QAAE,OAAO,OAAO,CAAA;IAC3B,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACtB,CAAC,CAAC,EAAE,EAAE,CAAC,OAAQ,CAA6B,CAAC,MAAM,CAAC,KAAK,QAAQ,CAChC,CAAA;QACnC,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,QAAQ;YACpF,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;IAClF,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { RpcRequest } from 'ox';
2
+ import { type Address, type Client } from 'viem';
3
+ import type { LocalAccount } from 'viem/accounts';
4
+ import { Transaction } from 'viem/tempo';
5
+ import { type Handler, from } from '../Handler.js';
6
+ import * as Store from '../internal/Store.js';
7
+ import * as Multisig from './internal/multisig.js';
8
+ /**
9
+ * Instantiates a relay handler that proxies `eth_fillTransaction`
10
+ * with wallet-aware enrichment (fee token resolution, simulation,
11
+ * sponsorship, AMM resolution).
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { Handler } from 'tempo-api/server'
16
+ *
17
+ * const handler = Handler.relay({ getClient })
18
+ *
19
+ * // Plug handler into your server framework of choice:
20
+ * createServer(handler.listener) // Node.js
21
+ * Bun.serve(handler) // Bun
22
+ * Deno.serve(handler) // Deno
23
+ * app.use(handler.listener) // Express
24
+ * app.all('*', c => handler.fetch(c.req.raw)) // Hono
25
+ * export const GET = handler.fetch // Next.js
26
+ * export const POST = handler.fetch // Next.js
27
+ * ```
28
+ *
29
+ * @example
30
+ * With sponsorship
31
+ *
32
+ * ```ts
33
+ * import { privateKeyToAccount } from 'viem/accounts'
34
+ * import { Handler } from 'tempo-api/server'
35
+ *
36
+ * const handler = Handler.relay({
37
+ * getClient,
38
+ * feePayer: {
39
+ * account: privateKeyToAccount('0x...'),
40
+ * },
41
+ * })
42
+ * ```
43
+ *
44
+ * @param options - Options.
45
+ * @returns Request handler.
46
+ */
47
+ export declare function relay(options: relay.Options): Handler;
48
+ export declare namespace relay {
49
+ type Options = from.Options & {
50
+ /**
51
+ * Auto-swap options.
52
+ */
53
+ autoSwap?: false | {
54
+ /** Slippage tolerance (e.g. 0.05 = 5%). @default 0.05 */
55
+ slippage?: number | undefined;
56
+ } | undefined;
57
+ /**
58
+ * Resolves a viem client for a chain id. The handler resolves the client
59
+ * from the `chainId` in the incoming transaction (falling back to the
60
+ * client's default chain). Called with no argument for the default client.
61
+ */
62
+ getClient: (chainId?: number) => Client;
63
+ /**
64
+ * Fee payer / sponsor configuration. When provided, the relay will
65
+ * sign `feePayerSignature` on the filled transaction.
66
+ */
67
+ feePayer?: {
68
+ /** Account to use as the fee payer. */
69
+ account: LocalAccount;
70
+ /** Preferred fee token the sponsor wants to pay fees in. */
71
+ feeToken?: Address | undefined;
72
+ /**
73
+ * Validates whether to sponsor the transaction. When omitted, all
74
+ * transactions are sponsored. Return `false` to reject sponsorship.
75
+ */
76
+ validate?: ((request: Transaction.TransactionRequest) => boolean | Promise<boolean>) | undefined;
77
+ /** Sponsor display name returned from `eth_fillTransaction`. */
78
+ name?: string | undefined;
79
+ /** Sponsor URL returned from `eth_fillTransaction`. */
80
+ url?: string | undefined;
81
+ } | undefined;
82
+ /**
83
+ * Native multisig configuration. When provided, the relay collects owner
84
+ * approvals from multisig raw transaction submissions and broadcasts once
85
+ * collected owner weight meets the configured threshold.
86
+ */
87
+ multisig?: Multisig.Options | undefined;
88
+ /**
89
+ * Relay features.
90
+ *
91
+ * - `'all'` — enables fee token resolution, auto-swap,
92
+ * fee payer, and simulation (balance diffs + fee breakdown).
93
+ * - `undefined` (default) — only fee payers.
94
+ */
95
+ features?: 'all' | undefined;
96
+ /**
97
+ * Allows app-provided external fee payer URLs to use non-HTTPS protocols
98
+ * or local/private hosts. Intended only for trusted development setups.
99
+ * @default false
100
+ */
101
+ internal_allowUnsafeUrls?: boolean | undefined;
102
+ /**
103
+ * In-process cache backing TIP-20 metadata and user fee-token preference
104
+ * memoization. Omit to read upstream on every fill.
105
+ */
106
+ cache?: Store.Store | undefined;
107
+ /** Function to call before handling the request. */
108
+ onRequest?: ((request: RpcRequest.RpcRequest) => Promise<void>) | undefined;
109
+ /** Path to use for the handler. @default "/" */
110
+ path?: string | undefined;
111
+ /**
112
+ * Resolves the known fee-token candidates for a chain. The relay checks
113
+ * the caller's balance for each candidate and picks the highest during
114
+ * fee-token resolution. Omit to disable fee-token resolution.
115
+ */
116
+ resolveTokens?: ((chainId: number) => readonly Address[] | Promise<readonly Address[]>) | undefined;
117
+ };
118
+ }
119
+ //# sourceMappingURL=relay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../src/handlers/relay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAe,MAAM,IAAI,CAAA;AAE3D,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,MAAM,EASZ,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAA0C,WAAW,EAAkB,MAAM,YAAY,CAAA;AAIhG,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAC7C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAA;AAIlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,KAAK,CAA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