@daimo/pay 0.0.2 → 0.0.4

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 (28) hide show
  1. package/build/index.es.js +3 -1
  2. package/build/index.es.js.map +1 -1
  3. package/build/packages/paykit/packages/connectkit/src/utils/getPaymentInfo.d.ts +3 -73
  4. package/build/packages/paykit/packages/connectkit/src/utils/trpc.d.ts +1 -956
  5. package/package.json +2 -1
  6. package/build/packages/pay-api/src/db/codegen/dbPay.d.ts +0 -69
  7. package/build/packages/pay-api/src/db/db.d.ts +0 -68
  8. package/build/packages/pay-api/src/db/migrations/0.d.ts +0 -2
  9. package/build/packages/pay-api/src/db/migrations/1.d.ts +0 -2
  10. package/build/packages/pay-api/src/db/migrations/2.d.ts +0 -2
  11. package/build/packages/pay-api/src/db/migrations/3.d.ts +0 -2
  12. package/build/packages/pay-api/src/env.d.ts +0 -10
  13. package/build/packages/pay-api/src/index.d.ts +0 -2
  14. package/build/packages/pay-api/src/server/binanceClient.d.ts +0 -14
  15. package/build/packages/pay-api/src/server/constants.d.ts +0 -3
  16. package/build/packages/pay-api/src/server/dfsQuoter.d.ts +0 -21
  17. package/build/packages/pay-api/src/server/externalPaymentOptions.d.ts +0 -21
  18. package/build/packages/pay-api/src/server/orderProcessor.d.ts +0 -48
  19. package/build/packages/pay-api/src/server/orgManager.d.ts +0 -22
  20. package/build/packages/pay-api/src/server/router.d.ts +0 -252
  21. package/build/packages/pay-api/src/server/swap.d.ts +0 -24
  22. package/build/packages/pay-api/src/server/tokenBalances.d.ts +0 -12
  23. package/build/packages/pay-api/src/server/tokenRegistry.d.ts +0 -16
  24. package/build/packages/pay-api/src/server/viemChainClient.d.ts +0 -252
  25. package/build/packages/pay-api/src/server/viemClient.d.ts +0 -19
  26. package/build/packages/pay-api/src/trpc.d.ts +0 -129
  27. package/build/packages/pay-api/src/utils/clippy.d.ts +0 -2
  28. package/build/packages/pay-api/src/utils/request.d.ts +0 -19
@@ -1,252 +0,0 @@
1
- import { Abi, Account, Chain, ContractFunctionName, ContractFunctionArgs, Hex, PublicClient, SendTransactionParameters, SendTransactionReturnType, Transport, WalletClient, WriteContractParameters } from "viem";
2
- /**
3
- * Loads a wallet from the local DAIMO_API_PRIVATE_KEY env var.
4
- * This account sponsors gas for account creation (and a faucet, on testnet).
5
- */
6
- export declare function getViemChainClientFromEnv(chainId: number): ViemChainClient;
7
- export declare function getEOA(privateKey: string): {
8
- address: `0x${string}`;
9
- nonceManager?: import("viem").NonceManager | undefined;
10
- sign: (parameters: {
11
- hash: `0x${string}`;
12
- }) => Promise<`0x${string}`>;
13
- experimental_signAuthorization: (parameters: import("viem/experimental").Authorization) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
14
- signMessage: ({ message }: {
15
- message: import("viem").SignableMessage;
16
- }) => Promise<`0x${string}`>;
17
- signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
18
- serializer?: serializer | undefined;
19
- } | undefined) => Promise<import("viem").IsNarrowable<import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>>, `0x${string}`> extends true ? import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>> : `0x${string}`>;
20
- signTypedData: <const typedData extends Record<string, unknown> | {
21
- [x: string]: readonly import("viem").TypedDataParameter[];
22
- [x: `string[${string}]`]: undefined;
23
- [x: `function[${string}]`]: undefined;
24
- [x: `address[${string}]`]: undefined;
25
- [x: `bool[${string}]`]: undefined;
26
- [x: `bytes[${string}]`]: undefined;
27
- [x: `bytes2[${string}]`]: undefined;
28
- [x: `bytes1[${string}]`]: undefined;
29
- [x: `bytes10[${string}]`]: undefined;
30
- [x: `bytes18[${string}]`]: undefined;
31
- [x: `bytes32[${string}]`]: undefined;
32
- [x: `bytes31[${string}]`]: undefined;
33
- [x: `bytes30[${string}]`]: undefined;
34
- [x: `bytes29[${string}]`]: undefined;
35
- [x: `bytes28[${string}]`]: undefined;
36
- [x: `bytes27[${string}]`]: undefined;
37
- [x: `bytes26[${string}]`]: undefined;
38
- [x: `bytes25[${string}]`]: undefined;
39
- [x: `bytes24[${string}]`]: undefined;
40
- [x: `bytes23[${string}]`]: undefined;
41
- [x: `bytes22[${string}]`]: undefined;
42
- [x: `bytes21[${string}]`]: undefined;
43
- [x: `bytes20[${string}]`]: undefined;
44
- [x: `bytes19[${string}]`]: undefined;
45
- [x: `bytes17[${string}]`]: undefined;
46
- [x: `bytes16[${string}]`]: undefined;
47
- [x: `bytes15[${string}]`]: undefined;
48
- [x: `bytes14[${string}]`]: undefined;
49
- [x: `bytes13[${string}]`]: undefined;
50
- [x: `bytes12[${string}]`]: undefined;
51
- [x: `bytes11[${string}]`]: undefined;
52
- [x: `bytes9[${string}]`]: undefined;
53
- [x: `bytes8[${string}]`]: undefined;
54
- [x: `bytes7[${string}]`]: undefined;
55
- [x: `bytes6[${string}]`]: undefined;
56
- [x: `bytes5[${string}]`]: undefined;
57
- [x: `bytes4[${string}]`]: undefined;
58
- [x: `bytes3[${string}]`]: undefined;
59
- [x: `int[${string}]`]: undefined;
60
- [x: `int40[${string}]`]: undefined;
61
- [x: `int32[${string}]`]: undefined;
62
- [x: `int24[${string}]`]: undefined;
63
- [x: `int16[${string}]`]: undefined;
64
- [x: `int8[${string}]`]: undefined;
65
- [x: `int48[${string}]`]: undefined;
66
- [x: `int56[${string}]`]: undefined;
67
- [x: `int64[${string}]`]: undefined;
68
- [x: `int72[${string}]`]: undefined;
69
- [x: `int80[${string}]`]: undefined;
70
- [x: `int88[${string}]`]: undefined;
71
- [x: `int96[${string}]`]: undefined;
72
- [x: `int104[${string}]`]: undefined;
73
- [x: `int112[${string}]`]: undefined;
74
- [x: `int120[${string}]`]: undefined;
75
- [x: `int128[${string}]`]: undefined;
76
- [x: `int136[${string}]`]: undefined;
77
- [x: `int144[${string}]`]: undefined;
78
- [x: `int152[${string}]`]: undefined;
79
- [x: `int160[${string}]`]: undefined;
80
- [x: `int168[${string}]`]: undefined;
81
- [x: `int176[${string}]`]: undefined;
82
- [x: `int184[${string}]`]: undefined;
83
- [x: `int192[${string}]`]: undefined;
84
- [x: `int200[${string}]`]: undefined;
85
- [x: `int208[${string}]`]: undefined;
86
- [x: `int216[${string}]`]: undefined;
87
- [x: `int224[${string}]`]: undefined;
88
- [x: `int232[${string}]`]: undefined;
89
- [x: `int240[${string}]`]: undefined;
90
- [x: `int248[${string}]`]: undefined;
91
- [x: `int256[${string}]`]: undefined;
92
- [x: `uint[${string}]`]: undefined;
93
- [x: `uint40[${string}]`]: undefined;
94
- [x: `uint32[${string}]`]: undefined;
95
- [x: `uint24[${string}]`]: undefined;
96
- [x: `uint16[${string}]`]: undefined;
97
- [x: `uint8[${string}]`]: undefined;
98
- [x: `uint48[${string}]`]: undefined;
99
- [x: `uint56[${string}]`]: undefined;
100
- [x: `uint64[${string}]`]: undefined;
101
- [x: `uint72[${string}]`]: undefined;
102
- [x: `uint80[${string}]`]: undefined;
103
- [x: `uint88[${string}]`]: undefined;
104
- [x: `uint96[${string}]`]: undefined;
105
- [x: `uint104[${string}]`]: undefined;
106
- [x: `uint112[${string}]`]: undefined;
107
- [x: `uint120[${string}]`]: undefined;
108
- [x: `uint128[${string}]`]: undefined;
109
- [x: `uint136[${string}]`]: undefined;
110
- [x: `uint144[${string}]`]: undefined;
111
- [x: `uint152[${string}]`]: undefined;
112
- [x: `uint160[${string}]`]: undefined;
113
- [x: `uint168[${string}]`]: undefined;
114
- [x: `uint176[${string}]`]: undefined;
115
- [x: `uint184[${string}]`]: undefined;
116
- [x: `uint192[${string}]`]: undefined;
117
- [x: `uint200[${string}]`]: undefined;
118
- [x: `uint208[${string}]`]: undefined;
119
- [x: `uint216[${string}]`]: undefined;
120
- [x: `uint224[${string}]`]: undefined;
121
- [x: `uint232[${string}]`]: undefined;
122
- [x: `uint240[${string}]`]: undefined;
123
- [x: `uint248[${string}]`]: undefined;
124
- [x: `uint256[${string}]`]: undefined;
125
- string?: undefined;
126
- address?: undefined;
127
- bool?: undefined;
128
- bytes?: undefined;
129
- bytes2?: undefined;
130
- bytes1?: undefined;
131
- bytes10?: undefined;
132
- bytes18?: undefined;
133
- bytes32?: undefined;
134
- bytes31?: undefined;
135
- bytes30?: undefined;
136
- bytes29?: undefined;
137
- bytes28?: undefined;
138
- bytes27?: undefined;
139
- bytes26?: undefined;
140
- bytes25?: undefined;
141
- bytes24?: undefined;
142
- bytes23?: undefined;
143
- bytes22?: undefined;
144
- bytes21?: undefined;
145
- bytes20?: undefined;
146
- bytes19?: undefined;
147
- bytes17?: undefined;
148
- bytes16?: undefined;
149
- bytes15?: undefined;
150
- bytes14?: undefined;
151
- bytes13?: undefined;
152
- bytes12?: undefined;
153
- bytes11?: undefined;
154
- bytes9?: undefined;
155
- bytes8?: undefined;
156
- bytes7?: undefined;
157
- bytes6?: undefined;
158
- bytes5?: undefined;
159
- bytes4?: undefined;
160
- bytes3?: undefined;
161
- int40?: undefined;
162
- int32?: undefined;
163
- int24?: undefined;
164
- int16?: undefined;
165
- int8?: undefined;
166
- int48?: undefined;
167
- int56?: undefined;
168
- int64?: undefined;
169
- int72?: undefined;
170
- int80?: undefined;
171
- int88?: undefined;
172
- int96?: undefined;
173
- int104?: undefined;
174
- int112?: undefined;
175
- int120?: undefined;
176
- int128?: undefined;
177
- int136?: undefined;
178
- int144?: undefined;
179
- int152?: undefined;
180
- int160?: undefined;
181
- int168?: undefined;
182
- int176?: undefined;
183
- int184?: undefined;
184
- int192?: undefined;
185
- int200?: undefined;
186
- int208?: undefined;
187
- int216?: undefined;
188
- int224?: undefined;
189
- int232?: undefined;
190
- int240?: undefined;
191
- int248?: undefined;
192
- int256?: undefined;
193
- uint40?: undefined;
194
- uint32?: undefined;
195
- uint24?: undefined;
196
- uint16?: undefined;
197
- uint8?: undefined;
198
- uint48?: undefined;
199
- uint56?: undefined;
200
- uint64?: undefined;
201
- uint72?: undefined;
202
- uint80?: undefined;
203
- uint88?: undefined;
204
- uint96?: undefined;
205
- uint104?: undefined;
206
- uint112?: undefined;
207
- uint120?: undefined;
208
- uint128?: undefined;
209
- uint136?: undefined;
210
- uint144?: undefined;
211
- uint152?: undefined;
212
- uint160?: undefined;
213
- uint168?: undefined;
214
- uint176?: undefined;
215
- uint184?: undefined;
216
- uint192?: undefined;
217
- uint200?: undefined;
218
- uint208?: undefined;
219
- uint216?: undefined;
220
- uint224?: undefined;
221
- uint232?: undefined;
222
- uint240?: undefined;
223
- uint248?: undefined;
224
- uint256?: undefined;
225
- }, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
226
- publicKey: `0x${string}`;
227
- source: "privateKey";
228
- type: "local";
229
- };
230
- /**
231
- * All access to the chain goes through this client. Unique to a chain.
232
- */
233
- export declare class ViemChainClient {
234
- rpcURL: string;
235
- publicClient: PublicClient<Transport, Chain>;
236
- walletClient: WalletClient<Transport, Chain, Account>;
237
- chain: Chain;
238
- private lockNonce;
239
- private nextNonce;
240
- account: Account;
241
- constructor(rpcURL: string, publicClient: PublicClient<Transport, Chain>, walletClient: WalletClient<Transport, Chain, Account>, chain: Chain);
242
- private onReceiptError;
243
- waitForReceipt(hash: Hex): Promise<void>;
244
- updateNonce(): Promise<void>;
245
- runWithOverrideParams<Args extends {
246
- nonce?: number;
247
- gas?: bigint;
248
- chain?: Chain | null;
249
- }, Ret>(args: Args, fn: (args: Args) => Ret): Promise<Ret>;
250
- writeContract<const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "payable" | "nonpayable">, TArgs extends ContractFunctionArgs<TAbi, "payable" | "nonpayable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(args: WriteContractParameters<TAbi, TFunctionName, TArgs, Chain, Account, TChainOverride>): Promise<Hex>;
251
- sendTransaction<TChainOverride extends Chain | undefined = undefined>(args: SendTransactionParameters<Chain, Account, TChainOverride>): Promise<SendTransactionReturnType>;
252
- }
@@ -1,19 +0,0 @@
1
- import { Abi, Account, Chain, ContractFunctionName, ContractFunctionArgs, Hex, SendTransactionParameters, SendTransactionReturnType, WriteContractParameters } from "viem";
2
- import { ViemChainClient } from "./viemChainClient";
3
- /**
4
- * Loads a wallet from the local DAIMO_API_PRIVATE_KEY env var.
5
- * This account sponsors gas for account creation (and a faucet, on testnet).
6
- */
7
- export declare function getViemClientFromEnv(): ViemClient;
8
- /**
9
- * All access to chains goes through this client.
10
- */
11
- export declare class ViemClient {
12
- private vcs;
13
- constructor(vcs: Map<number, ViemChainClient>);
14
- getSupportedMainnetChainIds(): number[];
15
- getSupportedTestnetChainIds(): number[];
16
- getChainClient(chainId: number): ViemChainClient;
17
- writeContract<const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "payable" | "nonpayable">, TArgs extends ContractFunctionArgs<TAbi, "payable" | "nonpayable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(chainId: number, args: WriteContractParameters<TAbi, TFunctionName, TArgs, Chain, Account, TChainOverride>): Promise<Hex>;
18
- sendTransaction<TChainOverride extends Chain | undefined = undefined>(chainId: number, args: SendTransactionParameters<Chain, Account, TChainOverride>): Promise<SendTransactionReturnType>;
19
- }
@@ -1,129 +0,0 @@
1
- /// <reference types="node" />
2
- import { TRPCError } from "@trpc/server";
3
- import { CreateHTTPContextOptions } from "@trpc/server/adapters/standalone";
4
- export type TrpcRequestContext = Awaited<ReturnType<typeof createContext>>;
5
- /** Request context */
6
- export declare const createContext: (opts: CreateHTTPContextOptions) => Promise<{
7
- auth: {
8
- organizationId: string;
9
- memberId: string;
10
- } | null;
11
- req: import("http").IncomingMessage;
12
- res: import("http").ServerResponse<import("http").IncomingMessage>;
13
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
14
- }>;
15
- export declare function onTrpcError(): ({ error, ctx }: {
16
- error: TRPCError;
17
- ctx?: {
18
- auth: {
19
- organizationId: string;
20
- memberId: string;
21
- } | null;
22
- req: import("http").IncomingMessage;
23
- res: import("http").ServerResponse<import("http").IncomingMessage>;
24
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
25
- } | undefined;
26
- }) => void;
27
- /**
28
- * Initialization of tRPC backend
29
- */
30
- export declare const trpcT: {
31
- _config: import("@trpc/server/unstable-core-do-not-import").RootConfig<{
32
- ctx: {
33
- auth: {
34
- organizationId: string;
35
- memberId: string;
36
- } | null;
37
- req: import("http").IncomingMessage;
38
- res: import("http").ServerResponse<import("http").IncomingMessage>;
39
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
40
- };
41
- meta: object;
42
- errorShape: import("@trpc/server/unstable-core-do-not-import").DefaultErrorShape;
43
- transformer: false;
44
- }>;
45
- procedure: import("@trpc/server/unstable-core-do-not-import").ProcedureBuilder<{
46
- auth: {
47
- organizationId: string;
48
- memberId: string;
49
- } | null;
50
- req: import("http").IncomingMessage;
51
- res: import("http").ServerResponse<import("http").IncomingMessage>;
52
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
53
- }, object, object, typeof import("@trpc/server/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/unstable-core-do-not-import").unsetMarker, false>;
54
- middleware: <$ContextOverrides>(fn: import("@trpc/server/unstable-core-do-not-import").MiddlewareFunction<{
55
- auth: {
56
- organizationId: string;
57
- memberId: string;
58
- } | null;
59
- req: import("http").IncomingMessage;
60
- res: import("http").ServerResponse<import("http").IncomingMessage>;
61
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
62
- }, object, object, $ContextOverrides, unknown>) => import("@trpc/server/unstable-core-do-not-import").MiddlewareBuilder<{
63
- auth: {
64
- organizationId: string;
65
- memberId: string;
66
- } | null;
67
- req: import("http").IncomingMessage;
68
- res: import("http").ServerResponse<import("http").IncomingMessage>;
69
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
70
- }, object, $ContextOverrides, unknown>;
71
- router: {
72
- <TInput extends import("@trpc/server").TRPCRouterRecord>(input: TInput): import("@trpc/server/unstable-core-do-not-import").BuiltRouter<{
73
- ctx: {
74
- auth: {
75
- organizationId: string;
76
- memberId: string;
77
- } | null;
78
- req: import("http").IncomingMessage;
79
- res: import("http").ServerResponse<import("http").IncomingMessage>;
80
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
81
- };
82
- meta: object;
83
- errorShape: import("@trpc/server/unstable-core-do-not-import").DefaultErrorShape;
84
- transformer: false;
85
- }, TInput>;
86
- <TInput_1 extends import("@trpc/server/unstable-core-do-not-import").CreateRouterOptions>(input: TInput_1): import("@trpc/server/unstable-core-do-not-import").BuiltRouter<{
87
- ctx: {
88
- auth: {
89
- organizationId: string;
90
- memberId: string;
91
- } | null;
92
- req: import("http").IncomingMessage;
93
- res: import("http").ServerResponse<import("http").IncomingMessage>;
94
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
95
- };
96
- meta: object;
97
- errorShape: import("@trpc/server/unstable-core-do-not-import").DefaultErrorShape;
98
- transformer: false;
99
- }, import("@trpc/server/unstable-core-do-not-import").DecorateCreateRouterOptions<TInput_1>>;
100
- };
101
- mergeRouters: typeof import("@trpc/server/unstable-core-do-not-import").mergeRouters;
102
- createCallerFactory: <TRecord extends import("@trpc/server").TRPCRouterRecord>(router: Pick<import("@trpc/server/unstable-core-do-not-import").Router<{
103
- ctx: {
104
- auth: {
105
- organizationId: string;
106
- memberId: string;
107
- } | null;
108
- req: import("http").IncomingMessage;
109
- res: import("http").ServerResponse<import("http").IncomingMessage>;
110
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
111
- };
112
- meta: object;
113
- errorShape: import("@trpc/server/unstable-core-do-not-import").DefaultErrorShape;
114
- transformer: false;
115
- }, TRecord>, "_def">) => import("@trpc/server/unstable-core-do-not-import").RouterCaller<{
116
- ctx: {
117
- auth: {
118
- organizationId: string;
119
- memberId: string;
120
- } | null;
121
- req: import("http").IncomingMessage;
122
- res: import("http").ServerResponse<import("http").IncomingMessage>;
123
- info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
124
- };
125
- meta: object;
126
- errorShape: import("@trpc/server/unstable-core-do-not-import").DefaultErrorShape;
127
- transformer: false;
128
- }, TRecord>;
129
- };
@@ -1,2 +0,0 @@
1
- /** Clippy is our Slack bot for API monitoring. */
2
- export declare function recordClippy(message: string, level?: "info" | "warn" | "error" | "celebrate"): void;
@@ -1,19 +0,0 @@
1
- export declare enum RequestMethod {
2
- POST = "POST",
3
- GET = "GET",
4
- PUT = "PUT"
5
- }
6
- export type RequestResponse<T> = {
7
- statusCode: number;
8
- body: T;
9
- };
10
- /**
11
- * Wrapper function for making requests, assumes request is idempotent
12
- * and will retry on failure and log timings
13
- */
14
- export declare function request<T>({ method, url, headers, jsonBody, }: {
15
- method: RequestMethod;
16
- url: string;
17
- headers: any;
18
- jsonBody?: any;
19
- }): Promise<RequestResponse<T>>;