@nexus-cross/pop 1.4.0-beta.1 → 1.4.0-beta.3

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.
@@ -1,5 +1,5 @@
1
- import { C as CryptoPort, g as Secret, u as SecretHash, H as Hex, A as Address, d as ClaimSignerPort, S as SafeDropChainPort, n as OnePopDrop, I as Id, k as DropState, a as SafeDropApiPort, v as SocialIdentifier, O as OAuthProof, i as DropInbox, E as Envelope, L as LeaderboardEntry, o as PopEventName, m as HistoryPage, X as XConnection, h as BatchClaimSignature, p as SafeDrop } from '../createSafeDrop-BSO9RQBD.js';
2
- import { PublicClient, WalletClient, Chain, Transport } from 'viem';
1
+ import { C as CryptoPort, g as Secret, z as SecretHash, H as Hex, A as Address, d as ClaimSignerPort, S as SafeDropChainPort, r as OnePopDrop, I as Id, k as DropState, a as SafeDropApiPort, F as SocialIdentifier, O as OAuthProof, i as DropInbox, E as Envelope, p as LeaderboardPage, q as MyLeaderboardEntry, o as HistoryType, m as HistoryPage, X as XConnection, s as RecipientChangeSignature, t as RecipientSignature, h as BatchClaimSignature, u as SafeDrop } from '../createSafeDrop-CayUX4w_.js';
2
+ import { PublicClient, WalletClient, Chain, Transport, Abi } from 'viem';
3
3
  import { X as XAuthPort, a as XTokenResult } from '../XAuthPort-BNJePosj.js';
4
4
 
5
5
  /**
@@ -34,26 +34,30 @@ declare class ViemClaimSignerAdapter implements ClaimSignerPort {
34
34
  }): Promise<Hex>;
35
35
  }
36
36
 
37
+ interface SafeDropTransactionFees {
38
+ /** 단건 write gas limit. */
39
+ gas?: bigint;
40
+ /** batch 고정 비용. */
41
+ batchBaseGas?: bigint;
42
+ /** batch 항목 1개당 추가 gas. */
43
+ batchGasPerDrop?: bigint;
44
+ /** batch gas limit 안전 상한. 초과하면 전송 전에 INVALID_PARAM. */
45
+ maxBatchGas?: bigint;
46
+ maxFeePerGas?: bigint;
47
+ maxPriorityFeePerGas?: bigint;
48
+ }
37
49
  interface ViemSafeDropChainAdapterOptions {
38
50
  address: Address;
39
51
  publicClient: PublicClient;
40
- /** approve/deposit/refund 서명용 지갑(연결된 MetaMask 등). */
52
+ /** deposit/refund 서명용 지갑(연결된 MetaMask 등). */
41
53
  walletClient: WalletClient;
42
54
  chain: Chain;
43
55
  /** withdraw용 임시 지갑 client의 RPC transport. 기본 http()(chain.rpcUrls). */
44
56
  transport?: Transport;
45
- /** withdraw gas/fee override. 기본 DEFAULT_WITHDRAW_GAS(gas-abstraction 대응). */
46
- withdrawFees?: {
47
- gas?: bigint;
48
- maxFeePerGas?: bigint;
49
- maxPriorityFeePerGas?: bigint;
50
- };
51
- /**
52
- * true면 EIP-2612 permit 예치를 쓴다(approve tx 없음, 서명 1회 + tx 1회).
53
- * 배포본마다 deposit 시그니처가 다르므로 opt-in이다 — permit deposit이 없는
54
- * 컨트랙트에 켜면 셀렉터가 없어 revert한다. 토큰도 permit을 지원해야 한다.
55
- */
56
- permit?: boolean;
57
+ /** 모든 write의 EIP-1559/gas override. batch gas = base + perDrop × count. */
58
+ transactionFees?: SafeDropTransactionFees;
59
+ /** @deprecated Use transactionFees. */
60
+ withdrawFees?: SafeDropTransactionFees;
57
61
  }
58
62
  /**
59
63
  * SafeDrop 컨트랙트 어댑터 (viem). ABI: src/infrastructure/safedrop_abi.json.
@@ -65,15 +69,11 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
65
69
  private readonly walletClient;
66
70
  private readonly chain;
67
71
  private readonly transport;
68
- private readonly withdrawFees;
69
- /**
70
- * permit 옵션을 켠 경우에만 채워진다. DepositUseCase는 이 프로퍼티의 존재
71
- * 여부로 approve tx를 건너뛸지 판단하므로, 미지원 배포본에서는 undefined여야 한다.
72
- */
73
- readonly depositWithPermit?: SafeDropChainPort['depositWithPermit'];
72
+ private readonly transactionFees;
73
+ readonly depositWithPermit: SafeDropChainPort['depositWithPermit'];
74
74
  constructor(options: ViemSafeDropChainAdapterOptions);
75
75
  getDropByKey(dropKey: Hex): Promise<OnePopDrop | null>;
76
- getDropKeyByClaimAddress(claimAddress: Address, sponsor?: Address): Promise<Hex | null>;
76
+ getDropKeyByClaimAddress(claimAddress: Address, sponsor: Address): Promise<Hex | null>;
77
77
  getPendingDropsById(params: {
78
78
  id: Id;
79
79
  }): Promise<readonly OnePopDrop[]>;
@@ -83,33 +83,13 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
83
83
  getPendingDropsBySponsor(params: {
84
84
  sponsor: Address;
85
85
  }): Promise<readonly OnePopDrop[]>;
86
- /**
87
- * drops(claimAddr). 배포본에 따라 반환 필드가 8개(Foundry ABI) 또는 5개(permit
88
- * 배포본)다 — 셀렉터가 같으므로 raw call 1회 후 디코딩만 나눈다. 8필드를 먼저
89
- * 시도하는 이유: 짧은 데이터(5필드=192B)를 8필드로 읽으면 **에러가 나서** 안전하게
90
- * 폴백되지만, 반대 순서면 8필드 데이터를 5필드로 조용히 오독한다.
91
- */
92
- getDrop(claimAddress: Address): Promise<DropState | null>;
93
- /** 에스크로가 고정한 단일 ERC20. 5필드 배포본에서 drop.token을 채운다. */
86
+ getDrop(claimAddress: Address, sponsor: Address): Promise<DropState | null>;
94
87
  private escrowToken;
95
88
  getClaimDigest(params: {
96
89
  recipient: Address;
97
90
  id: Id;
98
- salt: Hex;
99
- }): Promise<Hex>;
100
- approve(params: {
101
- token: Address;
102
- amount: bigint;
91
+ dropKey: Hex;
103
92
  }): Promise<Hex>;
104
- deposit(params: {
105
- claimAddress: Address;
106
- token: Address;
107
- amount: bigint;
108
- id: Id;
109
- secretHash: SecretHash;
110
- }): Promise<{
111
- txHash: Hex;
112
- }>;
113
93
  /**
114
94
  * permit 예치. approve tx 없이 typed-data 서명 1회 + deposit tx 1회.
115
95
  * 이 배포본의 deposit에는 token 인자가 없다 — 컨트랙트가 token()으로 고정한다.
@@ -129,20 +109,13 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
129
109
  * 토큰에서 ecrecover가 조용히 실패해 deposit 내부 revert로만 드러난다.
130
110
  */
131
111
  private permitDomain;
132
- withdraw(params: {
133
- claimKey: Hex;
134
- recipient: Address;
135
- id: Id;
136
- salt: Hex;
137
- signature: Hex;
138
- secret: Secret;
139
- }): Promise<Hex>;
140
112
  withdrawUnmapped(params: {
141
113
  claimKey: Hex;
142
114
  recipient: Address;
143
115
  id: Id;
144
116
  dropKey: Hex;
145
117
  secret: Secret;
118
+ signature?: Hex;
146
119
  onSubmitted?: (txHash: Hex) => void | Promise<void>;
147
120
  }): Promise<Hex>;
148
121
  withdrawMapped(params: {
@@ -152,6 +125,20 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
152
125
  batchWithdrawMapped(params: {
153
126
  count: number;
154
127
  }): Promise<Hex>;
128
+ batchWithdrawMappedByKeys(params: {
129
+ dropKeys: readonly Hex[];
130
+ }): Promise<Hex>;
131
+ withdrawUnmappedBatchByKeys(params: {
132
+ claimKey: Hex;
133
+ recipient: Address;
134
+ id: Id;
135
+ anchorDropKey: Hex;
136
+ secret: Secret;
137
+ nonce: bigint;
138
+ deadline: bigint;
139
+ dropKeys: readonly Hex[];
140
+ validatorSignature: Hex;
141
+ }): Promise<Hex>;
155
142
  /** validatorNonceById는 **bytes32(id 해시)** 로 키잉된다 — 원문 string이 아니다. */
156
143
  getValidatorNonce(params: {
157
144
  id: Id;
@@ -167,38 +154,37 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
167
154
  getClaimedRecipient(params: {
168
155
  id: Id;
169
156
  }): Promise<Address>;
170
- getLiveDropCount(params: {
157
+ refundByKey(params: {
158
+ dropKey: Hex;
159
+ }): Promise<Hex>;
160
+ getChangeNonce(params: {
171
161
  id: Id;
172
162
  }): Promise<bigint>;
173
- /**
174
- * 개별 withdraw와 달리 **연결된 수령인 지갑**이 보낸다 — 컨트랙트가 msg.sender와
175
- * 서명의 recipient를 대조하므로 임시 claim 지갑으로는 보낼 수 없다(가스 대납 대상도 아님).
176
- * simulate를 먼저 돌려 `ValidatorSigExpired`/`InvalidValidatorNonce`/
177
- * `ECDSAInvalidSignature`를 이름으로 드러낸다.
178
- */
179
- withdrawByValidator(params: {
180
- recipient: Address;
163
+ getPendingRecipientChange(params: {
164
+ id: Id;
165
+ }): Promise<Address>;
166
+ requestRecipientChange(params: {
167
+ id: Id;
168
+ newRecipient: Address;
169
+ }): Promise<Hex>;
170
+ completeRecipientChange(params: {
181
171
  id: Id;
182
172
  nonce: bigint;
183
173
  deadline: bigint;
184
- maxCount: number;
185
174
  signature: Hex;
186
175
  }): Promise<Hex>;
187
- refund(params: {
188
- claimAddress: Address;
189
- }): Promise<Hex>;
190
- refundByKey(params: {
191
- dropKey: Hex;
192
- }): Promise<Hex>;
193
- getChangeNonce(params: {
176
+ cancelRecipientChange(params: {
194
177
  id: Id;
195
- }): Promise<bigint>;
178
+ }): Promise<Hex>;
196
179
  resetRecipient(params: {
197
180
  id: Id;
198
181
  nonce: bigint;
199
182
  deadline: bigint;
200
183
  signature: Hex;
201
184
  }): Promise<Hex>;
185
+ private currentContractWrite;
186
+ private transactionOverrides;
187
+ private batchTransactionOverrides;
202
188
  private sponsorWrite;
203
189
  private confirm;
204
190
  private recoverRevertName;
@@ -206,9 +192,8 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
206
192
  }
207
193
 
208
194
  /**
209
- * one-pop-api 엔드포인트 — 패키지 내부 상수. onramp/adapters/endpoints.ts와
210
- * 동일한 컨벤션(Vite import.meta.env + Next literal process.env, override →
211
- * 환경 식별 → 기본 URL, https 검증)을 따른다.
195
+ * ONEpop 배포 설정 — API와 컨트랙트 주소를 동일한 환경 식별자로 선택한다.
196
+ * Vite import.meta.env + Next literal process.env 컨벤션을 따른다.
212
197
  *
213
198
  * 우선순위 (override):
214
199
  * 1) `VITE_ONE_POP_API_BASE_URL` (Vite 빌드)
@@ -219,6 +204,22 @@ declare class ViemSafeDropChainAdapter implements SafeDropChainPort {
219
204
  * 스펙: packages/pop/src/infrastructure/openapi.json (basePath `/api`)
220
205
  */
221
206
  type PopEnvironment = 'dev' | 'stage' | 'production';
207
+ interface PopContracts {
208
+ onePop: `0x${string}`;
209
+ permitErc20: `0x${string}`;
210
+ nft: `0x${string}`;
211
+ nftMinter: `0x${string}`;
212
+ validator: `0x${string}`;
213
+ feeRecipient: `0x${string}`;
214
+ }
215
+ interface PopDeployment {
216
+ apiBaseUrl: string;
217
+ contracts?: PopContracts;
218
+ }
219
+ /** ONEpop protocol fee: 5% (500 / 10,000 basis points). */
220
+ declare const ONE_POP_FEE_BPS: bigint;
221
+ declare const ONE_POP_BPS_DENOMINATOR: bigint;
222
+ declare const ONE_POP_DEPLOYMENTS: Readonly<Record<PopEnvironment, PopDeployment>>;
222
223
  interface PopApiPaths {
223
224
  /** POST — 임시 claim 지갑 생성 (Bearer JWT). */
224
225
  createWallet: string;
@@ -232,766 +233,141 @@ interface PopApiPaths {
232
233
  envelopes: string;
233
234
  /** GET — 토큰별 pending 잔액 상위 (공개). */
234
235
  leaderboards: string;
235
- /** GET — 내 온체인 이벤트 히스토리 (Bearer JWT). */
236
- histories: string;
237
- /** GET/POST/DELETE — X 연결 (Bearer JWT). */
238
- xConnections: string;
239
- /** POST — 일괄 수령 validator 서명 (Bearer JWT). */
240
- batchClaimSignature: string;
241
- /** GET — SSE 알림 스트림. pop은 구독하지 않는다(앱이 EventSource로 직접). */
242
- eventsSubscribe: string;
243
- }
244
- declare const DEFAULT_POP_API_PATHS: PopApiPaths;
245
- /** 환경변수(override → 환경 식별)로 one-pop-api base URL을 결정한다. */
246
- declare function getOnePopApiBaseUrl(): string;
247
- /** 환경변수(override → 기본)로 cross-auth base URL을 결정한다. */
248
- declare function getCrossAuthBaseUrl(): string;
249
-
250
- /**
251
- * one-pop-api HTTP 어댑터. 스키마: packages/pop/src/infrastructure/openapi.json
252
- * POST /wallets (Bearer JWT) → {address}
253
- * POST /wallets/private-key (oauth_token 본문) → {address,private_key}
254
- * GET /drops (Bearer JWT) → 수령 인박스
255
- * GET /envelopes (공개) → 카드 디자인
256
- * GET /leaderboards?token= (공개) → pending 상위
257
- * GET /histories (Bearer JWT) → 온체인 이벤트
258
- * GET|POST|DELETE /x-connections (Bearer JWT) → X 연결
259
- * POST /batch-claim-signature (Bearer JWT) → ValidatorClaim 서명
260
- *
261
- * base URL은 미지정 시 환경변수로 결정(getOnePopApiBaseUrl).
262
- * wei-scale 값은 응답의 10진 문자열 → BigInt로 변환해 내보낸다(CLAUDE.md §4).
263
- */
264
- interface HttpSafeDropApiAdapterOptions {
265
- /** 미지정 시 환경변수(VITE_/NEXT_PUBLIC_ONE_POP_*)로 결정. */
266
- baseUrl?: string;
267
- /** SIWE JWT 공급자. Bearer 인증이 필요한 모든 호출이 사용한다. */
268
- getJwt?: () => string | undefined | Promise<string | undefined>;
269
- /** 테스트/SSR용 fetch 주입. 기본 globalThis.fetch. */
270
- fetchImpl?: typeof fetch;
271
- /** 엔드포인트 경로 override. 기본 DEFAULT_POP_API_PATHS. */
272
- paths?: Partial<PopApiPaths>;
273
- }
274
- declare class HttpSafeDropApiAdapter implements SafeDropApiPort {
275
- private readonly baseUrl;
276
- private readonly fetchImpl;
277
- private readonly getJwt?;
278
- private readonly paths;
279
- constructor(options?: HttpSafeDropApiAdapterOptions);
280
- createClaimWallet(params: {
281
- sender: Address;
282
- recipient: SocialIdentifier;
283
- message?: string;
284
- envelopeId?: string;
285
- }): Promise<{
286
- claimAddress: Address;
287
- id: Id;
288
- isMapped: boolean;
289
- }>;
290
- recordDropMetadata(params: {
291
- txHash: Hex;
292
- message?: string;
293
- envelopeId?: string;
294
- }): Promise<void>;
295
- retrieveClaimKey(params: {
296
- claimAddress: Address;
297
- senderAddress: Address;
298
- oauth: OAuthProof;
299
- }): Promise<{
300
- isMapped: true;
301
- } | {
302
- isMapped: false;
303
- claimKey: Hex;
304
- claimAddress: Address;
305
- }>;
306
- listDrops(params?: {
307
- token?: Address;
308
- }): Promise<DropInbox>;
309
- listEnvelopes(params?: {
310
- locale?: string;
311
- }): Promise<readonly Envelope[]>;
312
- getLeaderboard(params: {
313
- token: Address;
314
- }): Promise<readonly LeaderboardEntry[]>;
315
- listHistories(params?: {
316
- event?: PopEventName;
317
- page?: number;
318
- pageSize?: number;
319
- }): Promise<HistoryPage>;
320
- getXConnection(): Promise<XConnection | null>;
321
- connectX(params: {
322
- oauth: OAuthProof;
323
- }): Promise<XConnection>;
324
- disconnectX(): Promise<void>;
325
- requestBatchClaimSignature(params: {
326
- id: Id;
327
- oauth: OAuthProof;
328
- nonce: bigint;
329
- deadline: bigint;
330
- }): Promise<BatchClaimSignature>;
331
- private request;
332
- }
333
-
334
- declare const SAFEDROP_ABI: readonly [{
335
- readonly type: "constructor";
336
- readonly inputs: readonly [{
337
- readonly name: "claimPeriod_";
338
- readonly type: "uint64";
339
- readonly internalType: "uint64";
340
- }];
341
- readonly stateMutability: "nonpayable";
342
- }, {
343
- readonly type: "function";
344
- readonly name: "claimDigest";
345
- readonly inputs: readonly [{
346
- readonly name: "recipient";
347
- readonly type: "address";
348
- readonly internalType: "address";
349
- }, {
350
- readonly name: "id";
351
- readonly type: "string";
352
- readonly internalType: "string";
353
- }, {
354
- readonly name: "salt";
355
- readonly type: "bytes32";
356
- readonly internalType: "bytes32";
357
- }];
358
- readonly outputs: readonly [{
359
- readonly name: "";
360
- readonly type: "bytes32";
361
- readonly internalType: "bytes32";
362
- }];
363
- readonly stateMutability: "view";
364
- }, {
365
- readonly type: "function";
366
- readonly name: "claimPeriod";
367
- readonly inputs: readonly [];
368
- readonly outputs: readonly [{
369
- readonly name: "";
370
- readonly type: "uint64";
371
- readonly internalType: "uint64";
372
- }];
373
- readonly stateMutability: "view";
374
- }, {
375
- readonly type: "function";
376
- readonly name: "claimedRecipientOf";
377
- readonly inputs: readonly [{
378
- readonly name: "id";
379
- readonly type: "string";
380
- readonly internalType: "string";
381
- }];
382
- readonly outputs: readonly [{
383
- readonly name: "";
384
- readonly type: "address";
385
- readonly internalType: "address";
386
- }];
387
- readonly stateMutability: "view";
388
- }, {
389
- readonly type: "function";
390
- readonly name: "deposit";
391
- readonly inputs: readonly [{
392
- readonly name: "claimAddr";
393
- readonly type: "address";
394
- readonly internalType: "address";
395
- }, {
396
- readonly name: "token";
397
- readonly type: "address";
398
- readonly internalType: "contract IERC20";
399
- }, {
400
- readonly name: "amount";
401
- readonly type: "uint256";
402
- readonly internalType: "uint256";
403
- }, {
404
- readonly name: "id";
405
- readonly type: "string";
406
- readonly internalType: "string";
407
- }, {
408
- readonly name: "secretHash";
409
- readonly type: "bytes32";
410
- readonly internalType: "bytes32";
411
- }];
412
- readonly outputs: readonly [];
413
- readonly stateMutability: "nonpayable";
414
- }, {
415
- readonly type: "function";
416
- readonly name: "depositCountOf";
417
- readonly inputs: readonly [{
418
- readonly name: "sponsor";
419
- readonly type: "address";
420
- readonly internalType: "address";
421
- }];
422
- readonly outputs: readonly [{
423
- readonly name: "";
424
- readonly type: "uint256";
425
- readonly internalType: "uint256";
426
- }];
427
- readonly stateMutability: "view";
428
- }, {
429
- readonly type: "function";
430
- readonly name: "depositsBySponsor";
431
- readonly inputs: readonly [{
432
- readonly name: "sponsor";
433
- readonly type: "address";
434
- readonly internalType: "address";
435
- }, {
436
- readonly name: "";
437
- readonly type: "uint256";
438
- readonly internalType: "uint256";
439
- }];
440
- readonly outputs: readonly [{
441
- readonly name: "claimAddr";
442
- readonly type: "address";
443
- readonly internalType: "address";
444
- }, {
445
- readonly name: "token";
446
- readonly type: "address";
447
- readonly internalType: "contract IERC20";
448
- }, {
449
- readonly name: "amount";
450
- readonly type: "uint128";
451
- readonly internalType: "uint128";
452
- }, {
453
- readonly name: "expiry";
454
- readonly type: "uint64";
455
- readonly internalType: "uint64";
456
- }, {
457
- readonly name: "secretHash";
458
- readonly type: "bytes32";
459
- readonly internalType: "bytes32";
460
- }, {
461
- readonly name: "id";
462
- readonly type: "string";
463
- readonly internalType: "string";
464
- }];
465
- readonly stateMutability: "view";
466
- }, {
467
- readonly type: "function";
468
- readonly name: "depositsOf";
469
- readonly inputs: readonly [{
470
- readonly name: "sponsor";
471
- readonly type: "address";
472
- readonly internalType: "address";
473
- }];
474
- readonly outputs: readonly [{
475
- readonly name: "";
476
- readonly type: "tuple[]";
477
- readonly internalType: "struct SafeDrop.DepositRecord[]";
478
- readonly components: readonly [{
479
- readonly name: "claimAddr";
480
- readonly type: "address";
481
- readonly internalType: "address";
482
- }, {
483
- readonly name: "token";
484
- readonly type: "address";
485
- readonly internalType: "contract IERC20";
486
- }, {
487
- readonly name: "amount";
488
- readonly type: "uint128";
489
- readonly internalType: "uint128";
490
- }, {
491
- readonly name: "expiry";
492
- readonly type: "uint64";
493
- readonly internalType: "uint64";
494
- }, {
495
- readonly name: "secretHash";
496
- readonly type: "bytes32";
497
- readonly internalType: "bytes32";
498
- }, {
499
- readonly name: "id";
500
- readonly type: "string";
501
- readonly internalType: "string";
502
- }];
503
- }];
504
- readonly stateMutability: "view";
505
- }, {
506
- readonly type: "function";
507
- readonly name: "drops";
508
- readonly inputs: readonly [{
509
- readonly name: "claimAddr";
510
- readonly type: "address";
511
- readonly internalType: "address";
512
- }];
513
- readonly outputs: readonly [{
514
- readonly name: "sponsor";
515
- readonly type: "address";
516
- readonly internalType: "address";
517
- }, {
518
- readonly name: "recordIndex";
519
- readonly type: "uint96";
520
- readonly internalType: "uint96";
521
- }, {
522
- readonly name: "token";
523
- readonly type: "address";
524
- readonly internalType: "contract IERC20";
525
- }, {
526
- readonly name: "amount";
527
- readonly type: "uint128";
528
- readonly internalType: "uint128";
529
- }, {
530
- readonly name: "expiry";
531
- readonly type: "uint64";
532
- readonly internalType: "uint64";
533
- }, {
534
- readonly name: "secretHash";
535
- readonly type: "bytes32";
536
- readonly internalType: "bytes32";
537
- }, {
538
- readonly name: "salt";
539
- readonly type: "bytes32";
540
- readonly internalType: "bytes32";
541
- }, {
542
- readonly name: "id";
543
- readonly type: "string";
544
- readonly internalType: "string";
545
- }];
546
- readonly stateMutability: "view";
547
- }, {
548
- readonly type: "function";
549
- readonly name: "eip712Domain";
550
- readonly inputs: readonly [];
551
- readonly outputs: readonly [{
552
- readonly name: "fields";
553
- readonly type: "bytes1";
554
- readonly internalType: "bytes1";
555
- }, {
556
- readonly name: "name";
557
- readonly type: "string";
558
- readonly internalType: "string";
559
- }, {
560
- readonly name: "version";
561
- readonly type: "string";
562
- readonly internalType: "string";
563
- }, {
564
- readonly name: "chainId";
565
- readonly type: "uint256";
566
- readonly internalType: "uint256";
567
- }, {
568
- readonly name: "verifyingContract";
569
- readonly type: "address";
570
- readonly internalType: "address";
571
- }, {
572
- readonly name: "salt";
573
- readonly type: "bytes32";
574
- readonly internalType: "bytes32";
575
- }, {
576
- readonly name: "extensions";
577
- readonly type: "uint256[]";
578
- readonly internalType: "uint256[]";
579
- }];
580
- readonly stateMutability: "view";
581
- }, {
582
- readonly type: "function";
583
- readonly name: "liveClaimAddrsById";
584
- readonly inputs: readonly [{
585
- readonly name: "id";
586
- readonly type: "string";
587
- readonly internalType: "string";
588
- }];
589
- readonly outputs: readonly [{
590
- readonly name: "";
591
- readonly type: "address[]";
592
- readonly internalType: "address[]";
593
- }];
594
- readonly stateMutability: "view";
595
- }, {
596
- readonly type: "function";
597
- readonly name: "liveDropCountById";
598
- readonly inputs: readonly [{
599
- readonly name: "id";
600
- readonly type: "string";
601
- readonly internalType: "string";
602
- }];
603
- readonly outputs: readonly [{
604
- readonly name: "";
605
- readonly type: "uint256";
606
- readonly internalType: "uint256";
607
- }];
608
- readonly stateMutability: "view";
609
- }, {
610
- readonly type: "function";
611
- readonly name: "liveDropsById";
612
- readonly inputs: readonly [{
613
- readonly name: "id";
614
- readonly type: "string";
615
- readonly internalType: "string";
616
- }];
617
- readonly outputs: readonly [{
618
- readonly name: "claimAddrs";
619
- readonly type: "address[]";
620
- readonly internalType: "address[]";
621
- }, {
622
- readonly name: "records";
623
- readonly type: "tuple[]";
624
- readonly internalType: "struct SafeDrop.Drop[]";
625
- readonly components: readonly [{
626
- readonly name: "sponsor";
627
- readonly type: "address";
628
- readonly internalType: "address";
629
- }, {
630
- readonly name: "recordIndex";
631
- readonly type: "uint96";
632
- readonly internalType: "uint96";
633
- }, {
634
- readonly name: "token";
635
- readonly type: "address";
636
- readonly internalType: "contract IERC20";
637
- }, {
638
- readonly name: "amount";
639
- readonly type: "uint128";
640
- readonly internalType: "uint128";
641
- }, {
642
- readonly name: "expiry";
643
- readonly type: "uint64";
644
- readonly internalType: "uint64";
645
- }, {
646
- readonly name: "secretHash";
647
- readonly type: "bytes32";
648
- readonly internalType: "bytes32";
649
- }, {
650
- readonly name: "salt";
651
- readonly type: "bytes32";
652
- readonly internalType: "bytes32";
653
- }, {
654
- readonly name: "id";
655
- readonly type: "string";
656
- readonly internalType: "string";
657
- }];
658
- }];
659
- readonly stateMutability: "view";
660
- }, {
661
- readonly type: "function";
662
- readonly name: "refund";
663
- readonly inputs: readonly [{
664
- readonly name: "claimAddr";
665
- readonly type: "address";
666
- readonly internalType: "address";
667
- }];
668
- readonly outputs: readonly [];
669
- readonly stateMutability: "nonpayable";
670
- }, {
671
- readonly type: "function";
672
- readonly name: "unclaimedCountOf";
673
- readonly inputs: readonly [{
674
- readonly name: "sponsor";
675
- readonly type: "address";
676
- readonly internalType: "address";
677
- }];
678
- readonly outputs: readonly [{
679
- readonly name: "";
680
- readonly type: "uint256";
681
- readonly internalType: "uint256";
682
- }];
683
- readonly stateMutability: "view";
684
- }, {
685
- readonly type: "function";
686
- readonly name: "unclaimedDepositsOf";
687
- readonly inputs: readonly [{
688
- readonly name: "sponsor";
689
- readonly type: "address";
690
- readonly internalType: "address";
691
- }];
692
- readonly outputs: readonly [{
693
- readonly name: "records";
694
- readonly type: "tuple[]";
695
- readonly internalType: "struct SafeDrop.DepositRecord[]";
696
- readonly components: readonly [{
697
- readonly name: "claimAddr";
698
- readonly type: "address";
699
- readonly internalType: "address";
700
- }, {
701
- readonly name: "token";
702
- readonly type: "address";
703
- readonly internalType: "contract IERC20";
704
- }, {
705
- readonly name: "amount";
706
- readonly type: "uint128";
707
- readonly internalType: "uint128";
708
- }, {
709
- readonly name: "expiry";
710
- readonly type: "uint64";
711
- readonly internalType: "uint64";
712
- }, {
713
- readonly name: "secretHash";
714
- readonly type: "bytes32";
715
- readonly internalType: "bytes32";
716
- }, {
717
- readonly name: "id";
718
- readonly type: "string";
719
- readonly internalType: "string";
720
- }];
721
- }];
722
- readonly stateMutability: "view";
723
- }, {
724
- readonly type: "function";
725
- readonly name: "unclaimedIndexesOf";
726
- readonly inputs: readonly [{
727
- readonly name: "sponsor";
728
- readonly type: "address";
729
- readonly internalType: "address";
730
- }];
731
- readonly outputs: readonly [{
732
- readonly name: "";
733
- readonly type: "uint256[]";
734
- readonly internalType: "uint256[]";
735
- }];
736
- readonly stateMutability: "view";
737
- }, {
738
- readonly type: "function";
739
- readonly name: "withdraw";
740
- readonly inputs: readonly [{
741
- readonly name: "recipient";
742
- readonly type: "address";
743
- readonly internalType: "address";
744
- }, {
745
- readonly name: "id";
746
- readonly type: "string";
747
- readonly internalType: "string";
748
- }, {
749
- readonly name: "salt";
750
- readonly type: "bytes32";
751
- readonly internalType: "bytes32";
752
- }, {
753
- readonly name: "signature";
754
- readonly type: "bytes";
755
- readonly internalType: "bytes";
756
- }, {
757
- readonly name: "secret";
758
- readonly type: "bytes";
759
- readonly internalType: "bytes";
760
- }];
761
- readonly outputs: readonly [];
762
- readonly stateMutability: "nonpayable";
763
- }, {
764
- readonly type: "event";
765
- readonly name: "Deposited";
766
- readonly inputs: readonly [{
767
- readonly name: "claimAddr";
768
- readonly type: "address";
769
- readonly indexed: true;
770
- readonly internalType: "address";
771
- }, {
772
- readonly name: "sponsor";
773
- readonly type: "address";
774
- readonly indexed: true;
775
- readonly internalType: "address";
776
- }, {
777
- readonly name: "token";
778
- readonly type: "address";
779
- readonly indexed: true;
780
- readonly internalType: "address";
781
- }, {
782
- readonly name: "amount";
783
- readonly type: "uint256";
784
- readonly indexed: false;
785
- readonly internalType: "uint256";
786
- }, {
787
- readonly name: "id";
788
- readonly type: "string";
789
- readonly indexed: false;
790
- readonly internalType: "string";
791
- }, {
792
- readonly name: "expiry";
793
- readonly type: "uint64";
794
- readonly indexed: false;
795
- readonly internalType: "uint64";
796
- }, {
797
- readonly name: "secretHash";
798
- readonly type: "bytes32";
799
- readonly indexed: false;
800
- readonly internalType: "bytes32";
801
- }];
802
- readonly anonymous: false;
803
- }, {
804
- readonly type: "event";
805
- readonly name: "EIP712DomainChanged";
806
- readonly inputs: readonly [];
807
- readonly anonymous: false;
808
- }, {
809
- readonly type: "event";
810
- readonly name: "Refunded";
811
- readonly inputs: readonly [{
812
- readonly name: "claimAddr";
813
- readonly type: "address";
814
- readonly indexed: true;
815
- readonly internalType: "address";
816
- }, {
817
- readonly name: "sponsor";
818
- readonly type: "address";
819
- readonly indexed: true;
820
- readonly internalType: "address";
821
- }, {
822
- readonly name: "id";
823
- readonly type: "string";
824
- readonly indexed: false;
825
- readonly internalType: "string";
826
- }, {
827
- readonly name: "amount";
828
- readonly type: "uint256";
829
- readonly indexed: false;
830
- readonly internalType: "uint256";
831
- }];
832
- readonly anonymous: false;
833
- }, {
834
- readonly type: "event";
835
- readonly name: "Withdrawn";
836
- readonly inputs: readonly [{
837
- readonly name: "claimAddr";
838
- readonly type: "address";
839
- readonly indexed: true;
840
- readonly internalType: "address";
841
- }, {
842
- readonly name: "recipient";
843
- readonly type: "address";
844
- readonly indexed: true;
845
- readonly internalType: "address";
846
- }, {
847
- readonly name: "sponsor";
848
- readonly type: "address";
849
- readonly indexed: true;
850
- readonly internalType: "address";
851
- }, {
852
- readonly name: "id";
853
- readonly type: "string";
854
- readonly indexed: false;
855
- readonly internalType: "string";
856
- }, {
857
- readonly name: "amount";
858
- readonly type: "uint256";
859
- readonly indexed: false;
860
- readonly internalType: "uint256";
861
- }];
862
- readonly anonymous: false;
863
- }, {
864
- readonly type: "error";
865
- readonly name: "AmountOverflow";
866
- readonly inputs: readonly [];
867
- }, {
868
- readonly type: "error";
869
- readonly name: "DropAlreadyExists";
870
- readonly inputs: readonly [];
871
- }, {
872
- readonly type: "error";
873
- readonly name: "DropExpired";
874
- readonly inputs: readonly [];
875
- }, {
876
- readonly type: "error";
877
- readonly name: "DropNotExpired";
878
- readonly inputs: readonly [];
879
- }, {
880
- readonly type: "error";
881
- readonly name: "DropNotFound";
882
- readonly inputs: readonly [];
883
- }, {
884
- readonly type: "error";
885
- readonly name: "DuplicateDropForId";
886
- readonly inputs: readonly [];
887
- }, {
888
- readonly type: "error";
889
- readonly name: "ECDSAInvalidSignature";
890
- readonly inputs: readonly [];
891
- }, {
892
- readonly type: "error";
893
- readonly name: "ECDSAInvalidSignatureLength";
894
- readonly inputs: readonly [{
895
- readonly name: "length";
896
- readonly type: "uint256";
897
- readonly internalType: "uint256";
898
- }];
899
- }, {
900
- readonly type: "error";
901
- readonly name: "ECDSAInvalidSignatureS";
902
- readonly inputs: readonly [{
903
- readonly name: "s";
904
- readonly type: "bytes32";
905
- readonly internalType: "bytes32";
906
- }];
907
- }, {
908
- readonly type: "error";
909
- readonly name: "EmptyId";
910
- readonly inputs: readonly [];
911
- }, {
912
- readonly type: "error";
913
- readonly name: "IdMismatch";
914
- readonly inputs: readonly [];
915
- }, {
916
- readonly type: "error";
917
- readonly name: "InvalidShortString";
918
- readonly inputs: readonly [];
919
- }, {
920
- readonly type: "error";
921
- readonly name: "NotSponsor";
922
- readonly inputs: readonly [];
923
- }, {
924
- readonly type: "error";
925
- readonly name: "ReentrancyGuardReentrantCall";
926
- readonly inputs: readonly [];
927
- }, {
928
- readonly type: "error";
929
- readonly name: "SafeERC20FailedOperation";
930
- readonly inputs: readonly [{
931
- readonly name: "token";
932
- readonly type: "address";
933
- readonly internalType: "address";
934
- }];
935
- }, {
936
- readonly type: "error";
937
- readonly name: "SaltMismatch";
938
- readonly inputs: readonly [];
939
- }, {
940
- readonly type: "error";
941
- readonly name: "SecretMismatch";
942
- readonly inputs: readonly [];
943
- }, {
944
- readonly type: "error";
945
- readonly name: "StringTooLong";
946
- readonly inputs: readonly [{
947
- readonly name: "str";
948
- readonly type: "string";
949
- readonly internalType: "string";
950
- }];
951
- }, {
952
- readonly type: "error";
953
- readonly name: "ZeroAmount";
954
- readonly inputs: readonly [];
955
- }, {
956
- readonly type: "error";
957
- readonly name: "ZeroClaimAddress";
958
- readonly inputs: readonly [];
959
- }, {
960
- readonly type: "error";
961
- readonly name: "ZeroRecipient";
962
- readonly inputs: readonly [];
963
- }, {
964
- readonly type: "error";
965
- readonly name: "ZeroToken";
966
- readonly inputs: readonly [];
967
- }];
236
+ leaderboardMe: string;
237
+ /** GET — 내 온체인 이벤트 히스토리 (Bearer JWT). */
238
+ histories: string;
239
+ /** GET/POST/DELETE — X 연결 (Bearer JWT). */
240
+ xConnections: string;
241
+ /** POST — 일괄 수령 validator 서명 (Bearer JWT). */
242
+ batchClaimSignature: string;
243
+ feedbacks: string;
244
+ revealYou: string;
245
+ recipientChangeSignature: string;
246
+ recipientResetSignature: string;
247
+ /** GET — SSE 알림 스트림. pop은 구독하지 않는다(앱이 EventSource로 직접). */
248
+ eventsSubscribe: string;
249
+ }
250
+ declare const DEFAULT_POP_API_PATHS: PopApiPaths;
251
+ declare function getPopEnvironment(): PopEnvironment;
252
+ declare function getOnePopDeployment(): PopDeployment;
253
+ declare function getOnePopContracts(): PopContracts;
254
+ /** 환경변수(override → 환경 식별)로 one-pop-api base URL을 결정한다. */
255
+ declare function getOnePopApiBaseUrl(): string;
256
+ /** 환경변수(override → 기본)로 cross-auth base URL을 결정한다. */
257
+ declare function getCrossAuthBaseUrl(): string;
968
258
 
969
259
  /**
970
- * 일괄 수령(batch claim) ABI — **배포 바이트코드에서 검증한** as-built 기록.
971
- *
972
- * `src/infrastructure/safedrop_abi.json`(Foundry 산출물)에는 이 함수들이 없다.
973
- * 반대로 openapi.json 설명이 말하는 `validatorNonceById`는 **string이 아니라
974
- * bytes32(=keccak256(utf8(id)))** 를 받는다. 그래서 자동 생성 ABI를 믿지 않고
975
- * 배포본(CROSS testnet 612044 `0x50911242D9EA1554297ad11eb634230C56ae769c`)의
976
- * dispatcher 셀렉터로 직접 확인한 시그니처만 여기 둔다 (2026-07-30 검증):
977
- *
978
- * 3a5381b5 validator()
979
- * aee5b003 validatorClaimDigest(address,string,uint256,uint256)
980
- * dc4d9bff validatorNonceById(bytes32) ← id는 **해시**로 키잉
981
- * a730b8c5 withdrawByValidator(address,string,uint256,uint256,uint256,bytes)
982
- * 0d14a67d ValidatorSigExpired()
983
- * dcf5a899 InvalidValidatorNonce()
984
- *
985
- * eth_call로 확인한 검증 순서: deadline → nonce → 서명(ECDSA).
986
- * `maxCount`는 **서명 대상이 아니다** — 그래서 서명 1건으로 페이지네이션을 계속
987
- * 재사용할 수 있다(openapi 설명과 일치). 온체인 상한은 없고 가스가 한계다.
260
+ * one-pop-api HTTP 어댑터. 스키마: packages/pop/src/infrastructure/openapi.json
261
+ * POST /wallets (Bearer JWT) → {address}
262
+ * POST /wallets/private-key (oauth_token 본문) → {address,private_key}
263
+ * GET /drops (Bearer JWT) → 수령 인박스
264
+ * GET /envelopes (공개) → 카드 디자인
265
+ * GET /leaderboards?token= (공개) → pending 상위
266
+ * GET /histories (Bearer JWT) → 온체인 이벤트
267
+ * GET|POST|DELETE /x-connections (Bearer JWT) → X 연결
268
+ * POST /batch-claim-signature (Bearer JWT) → ValidatorClaim 서명
988
269
  *
989
- * EIP-712 (배포본 `eip712Domain()`으로 확인):
990
- * domain = { name: 'ONEpop', version: '1', chainId, verifyingContract: SafeDrop }
991
- * type = ValidatorClaim(address recipient,string id,uint256 nonce,uint256 deadline)
992
- * → digest는 `validatorClaimDigest()`가 온체인에서 그대로 돌려주므로, 로컬에서
993
- * 재조립하지 말고 그 값을 읽어 쓴다(백엔드와의 불일치를 가스 전에 잡는다).
270
+ * base URL은 미지정 시 환경변수로 결정(getOnePopApiBaseUrl).
271
+ * wei-scale 값은 응답의 10진 문자열 → BigInt로 변환해 내보낸다(CLAUDE.md §4).
994
272
  */
273
+ interface HttpSafeDropApiAdapterOptions {
274
+ /** 미지정 시 환경변수(VITE_/NEXT_PUBLIC_ONE_POP_*)로 결정. */
275
+ baseUrl?: string;
276
+ /** SIWE JWT 공급자. Bearer 인증이 필요한 모든 호출이 사용한다. */
277
+ getJwt?: () => string | undefined | Promise<string | undefined>;
278
+ /** 테스트/SSR용 fetch 주입. 기본 globalThis.fetch. */
279
+ fetchImpl?: typeof fetch;
280
+ /** 엔드포인트 경로 override. 기본 DEFAULT_POP_API_PATHS. */
281
+ paths?: Partial<PopApiPaths>;
282
+ }
283
+ declare class HttpSafeDropApiAdapter implements SafeDropApiPort {
284
+ private readonly baseUrl;
285
+ private readonly fetchImpl;
286
+ private readonly getJwt?;
287
+ private readonly paths;
288
+ constructor(options?: HttpSafeDropApiAdapterOptions);
289
+ createClaimWallet(params: {
290
+ sender: Address;
291
+ recipient: SocialIdentifier;
292
+ }): Promise<{
293
+ claimAddress: Address;
294
+ id: Id;
295
+ isMapped: boolean;
296
+ }>;
297
+ recordDropMetadata(params: {
298
+ txHash: Hex;
299
+ message?: string;
300
+ envelopeId?: string;
301
+ }): Promise<void>;
302
+ retrieveClaimKey(params: {
303
+ claimAddress: Address;
304
+ senderAddress: Address;
305
+ oauth: OAuthProof;
306
+ }): Promise<{
307
+ isMapped: true;
308
+ } | {
309
+ isMapped: false;
310
+ claimKey: Hex;
311
+ claimAddress: Address;
312
+ }>;
313
+ listDrops(params?: {
314
+ token?: Address;
315
+ }): Promise<DropInbox>;
316
+ listEnvelopes(params?: {
317
+ locale?: string;
318
+ }): Promise<readonly Envelope[]>;
319
+ getLeaderboard(params: {
320
+ token: Address;
321
+ page?: number;
322
+ pageSize?: number;
323
+ identifier?: string;
324
+ }): Promise<LeaderboardPage>;
325
+ getMyLeaderboardEntry(params: {
326
+ token: Address;
327
+ }): Promise<MyLeaderboardEntry>;
328
+ listHistories(params: {
329
+ type: HistoryType;
330
+ token?: Address;
331
+ page?: number;
332
+ pageSize?: number;
333
+ }): Promise<HistoryPage>;
334
+ getXConnection(): Promise<XConnection | null>;
335
+ connectX(params: {
336
+ oauth: OAuthProof;
337
+ }): Promise<XConnection>;
338
+ disconnectX(): Promise<void>;
339
+ submitFeedback(params: {
340
+ dropId: number;
341
+ message: string;
342
+ }): Promise<string>;
343
+ setRevealYou(params: {
344
+ revealYou: boolean;
345
+ }): Promise<boolean>;
346
+ requestRecipientChangeSignature(params: {
347
+ id: Id;
348
+ oauth: OAuthProof;
349
+ nonce: bigint;
350
+ deadline: bigint;
351
+ }): Promise<RecipientChangeSignature>;
352
+ requestRecipientResetSignature(params: {
353
+ id: Id;
354
+ oauth: OAuthProof;
355
+ nonce: bigint;
356
+ deadline: bigint;
357
+ }): Promise<RecipientSignature>;
358
+ requestBatchClaimSignature(params: {
359
+ id: Id;
360
+ oauth: OAuthProof;
361
+ nonce: bigint;
362
+ deadline: bigint;
363
+ }): Promise<BatchClaimSignature>;
364
+ private request;
365
+ }
366
+
367
+ /** Full current ONEpop ABI, sourced directly from the bundled artifact. */
368
+ declare const SAFEDROP_ABI: Abi;
369
+
370
+ /** Validator reads and errors used by the current batch flow. */
995
371
  declare const SAFEDROP_VALIDATOR_ABI: readonly [{
996
372
  readonly type: "function";
997
373
  readonly name: "validator";
@@ -1031,41 +407,6 @@ declare const SAFEDROP_VALIDATOR_ABI: readonly [{
1031
407
  readonly outputs: readonly [{
1032
408
  readonly type: "uint256";
1033
409
  }];
1034
- }, {
1035
- readonly type: "function";
1036
- readonly name: "withdrawByValidator";
1037
- readonly stateMutability: "nonpayable";
1038
- readonly inputs: readonly [{
1039
- readonly name: "recipient";
1040
- readonly type: "address";
1041
- }, {
1042
- readonly name: "id";
1043
- readonly type: "string";
1044
- }, {
1045
- readonly name: "nonce";
1046
- readonly type: "uint256";
1047
- }, {
1048
- readonly name: "deadline";
1049
- readonly type: "uint256";
1050
- }, {
1051
- readonly name: "maxCount";
1052
- readonly type: "uint256";
1053
- }, {
1054
- readonly name: "signature";
1055
- readonly type: "bytes";
1056
- }];
1057
- readonly outputs: readonly [];
1058
- }, {
1059
- readonly type: "function";
1060
- readonly name: "liveDropCountById";
1061
- readonly stateMutability: "view";
1062
- readonly inputs: readonly [{
1063
- readonly name: "id";
1064
- readonly type: "string";
1065
- }];
1066
- readonly outputs: readonly [{
1067
- readonly type: "uint256";
1068
- }];
1069
410
  }, {
1070
411
  readonly type: "function";
1071
412
  readonly name: "claimedRecipientOf";
@@ -1093,6 +434,9 @@ declare const ONEPOP_ABI: readonly [{
1093
434
  readonly name: "activeDropOf";
1094
435
  readonly stateMutability: "view";
1095
436
  readonly inputs: readonly [{
437
+ readonly name: "sponsor";
438
+ readonly type: "address";
439
+ }, {
1096
440
  readonly name: "claimAddr";
1097
441
  readonly type: "address";
1098
442
  }];
@@ -1309,6 +653,39 @@ declare const ONEPOP_ABI: readonly [{
1309
653
  readonly type: "bytes";
1310
654
  }];
1311
655
  readonly outputs: readonly [];
656
+ }, {
657
+ readonly type: "function";
658
+ readonly name: "withdrawUnmappedBatchByKeys";
659
+ readonly stateMutability: "nonpayable";
660
+ readonly inputs: readonly [{
661
+ readonly name: "recipient";
662
+ readonly type: "address";
663
+ }, {
664
+ readonly name: "id";
665
+ readonly type: "string";
666
+ }, {
667
+ readonly name: "anchorDropKey";
668
+ readonly type: "bytes32";
669
+ }, {
670
+ readonly name: "signature";
671
+ readonly type: "bytes";
672
+ }, {
673
+ readonly name: "secret";
674
+ readonly type: "bytes";
675
+ }, {
676
+ readonly name: "nonce";
677
+ readonly type: "uint256";
678
+ }, {
679
+ readonly name: "deadline";
680
+ readonly type: "uint256";
681
+ }, {
682
+ readonly name: "dropKeys";
683
+ readonly type: "bytes32[]";
684
+ }, {
685
+ readonly name: "validatorSignature";
686
+ readonly type: "bytes";
687
+ }];
688
+ readonly outputs: readonly [];
1312
689
  }, {
1313
690
  readonly type: "function";
1314
691
  readonly name: "withdrawMapped";
@@ -1327,6 +704,15 @@ declare const ONEPOP_ABI: readonly [{
1327
704
  readonly type: "uint256";
1328
705
  }];
1329
706
  readonly outputs: readonly [];
707
+ }, {
708
+ readonly type: "function";
709
+ readonly name: "batchWithdrawMapped";
710
+ readonly stateMutability: "nonpayable";
711
+ readonly inputs: readonly [{
712
+ readonly name: "dropKeys";
713
+ readonly type: "bytes32[]";
714
+ }];
715
+ readonly outputs: readonly [];
1330
716
  }, {
1331
717
  readonly type: "function";
1332
718
  readonly name: "refund";
@@ -1347,6 +733,57 @@ declare const ONEPOP_ABI: readonly [{
1347
733
  readonly outputs: readonly [{
1348
734
  readonly type: "uint256";
1349
735
  }];
736
+ }, {
737
+ readonly type: "function";
738
+ readonly name: "pendingRecipientChange";
739
+ readonly stateMutability: "view";
740
+ readonly inputs: readonly [{
741
+ readonly name: "idKey";
742
+ readonly type: "bytes32";
743
+ }];
744
+ readonly outputs: readonly [{
745
+ readonly name: "newRecipient";
746
+ readonly type: "address";
747
+ }];
748
+ }, {
749
+ readonly type: "function";
750
+ readonly name: "requestRecipientChange";
751
+ readonly stateMutability: "nonpayable";
752
+ readonly inputs: readonly [{
753
+ readonly name: "id";
754
+ readonly type: "string";
755
+ }, {
756
+ readonly name: "newRecipient";
757
+ readonly type: "address";
758
+ }];
759
+ readonly outputs: readonly [];
760
+ }, {
761
+ readonly type: "function";
762
+ readonly name: "completeRecipientChange";
763
+ readonly stateMutability: "nonpayable";
764
+ readonly inputs: readonly [{
765
+ readonly name: "id";
766
+ readonly type: "string";
767
+ }, {
768
+ readonly name: "nonce";
769
+ readonly type: "uint256";
770
+ }, {
771
+ readonly name: "deadline";
772
+ readonly type: "uint256";
773
+ }, {
774
+ readonly name: "validatorSignature";
775
+ readonly type: "bytes";
776
+ }];
777
+ readonly outputs: readonly [];
778
+ }, {
779
+ readonly type: "function";
780
+ readonly name: "cancelRecipientChange";
781
+ readonly stateMutability: "nonpayable";
782
+ readonly inputs: readonly [{
783
+ readonly name: "id";
784
+ readonly type: "string";
785
+ }];
786
+ readonly outputs: readonly [];
1350
787
  }, {
1351
788
  readonly type: "function";
1352
789
  readonly name: "resetRecipient";
@@ -1365,6 +802,38 @@ declare const ONEPOP_ABI: readonly [{
1365
802
  readonly type: "bytes";
1366
803
  }];
1367
804
  readonly outputs: readonly [];
805
+ }, ...{
806
+ type: "error";
807
+ name: "AlreadyMapped" | "AmountOverflow" | "ChangeAlreadyRequested" | "ChangeInProgress" | "CountExceedsPending" | "DropAlreadyExists" | "DropNotFound" | "ECDSAInvalidSignature" | "EmptyId" | "IdMismatch" | "IdNotMapped" | "InvalidClaimSignature" | "InvalidShortString" | "InvalidValidatorNonce" | "InvalidValidatorSignature" | "NoPendingChange" | "NotRecipient" | "NotSponsor" | "PendingLimitExceeded" | "RecipientNotEmpty" | "ReentrancyGuardReentrantCall" | "SameRecipient" | "SecretMismatch" | "ValidatorSigExpired" | "ZeroAmount" | "ZeroClaimAddress" | "ZeroCount" | "ZeroRecipient" | "ZeroSbt" | "ZeroSecretHash" | "ZeroToken" | "ZeroValidator";
808
+ inputs: readonly [];
809
+ }[], {
810
+ readonly type: "error";
811
+ readonly name: "ECDSAInvalidSignatureLength";
812
+ readonly inputs: readonly [{
813
+ readonly name: "length";
814
+ readonly type: "uint256";
815
+ }];
816
+ }, {
817
+ readonly type: "error";
818
+ readonly name: "ECDSAInvalidSignatureS";
819
+ readonly inputs: readonly [{
820
+ readonly name: "s";
821
+ readonly type: "bytes32";
822
+ }];
823
+ }, {
824
+ readonly type: "error";
825
+ readonly name: "SafeERC20FailedOperation";
826
+ readonly inputs: readonly [{
827
+ readonly name: "token";
828
+ readonly type: "address";
829
+ }];
830
+ }, {
831
+ readonly type: "error";
832
+ readonly name: "StringTooLong";
833
+ readonly inputs: readonly [{
834
+ readonly name: "str";
835
+ readonly type: "string";
836
+ }];
1368
837
  }];
1369
838
 
1370
839
  /**
@@ -1402,21 +871,18 @@ declare class CrossAuthClient {
1402
871
  }
1403
872
 
1404
873
  interface CreateSafeDropClientOptions {
1405
- /** SafeDrop 컨트랙트 주소. */
1406
- contractAddress: Address;
874
+ /** SafeDrop 컨트랙트 주소. 미지정 시 ONE_POP_ENVIRONMENT 배포 설정. */
875
+ contractAddress?: Address;
1407
876
  publicClient: PublicClient;
1408
- /** approve/deposit/refund 서명용 연결 지갑. */
877
+ /** deposit/refund 서명용 연결 지갑. */
1409
878
  walletClient: WalletClient;
1410
879
  chain: Chain;
1411
880
  /** withdraw 임시 지갑 client의 RPC transport. */
1412
881
  transport?: Transport;
1413
- /** withdraw gas/fee override (gas-abstraction). */
882
+ /** @deprecated Use transactionFees. */
1414
883
  withdrawFees?: ViemSafeDropChainAdapterOptions['withdrawFees'];
1415
- /**
1416
- * true면 EIP-2612 permit 예치 — approve tx가 사라지고 서명 1회 + tx 1회가 된다.
1417
- * SafeDrop 배포본과 토큰 양쪽이 permit을 지원할 때만 켠다.
1418
- */
1419
- permit?: boolean;
884
+ /** 모든 contract write의 EIP-1559/gas override. */
885
+ transactionFees?: ViemSafeDropChainAdapterOptions['transactionFees'];
1420
886
  /** 수령 링크 base URL. */
1421
887
  claimBaseUrl: string;
1422
888
  /** one-pop-api 어댑터 옵션(baseUrl 미지정 시 환경변수). */
@@ -1511,4 +977,4 @@ declare class XAuthClient {
1511
977
  }>;
1512
978
  }
1513
979
 
1514
- export { type CreateSafeDropClientOptions, CrossAuthClient, type CrossAuthClientOptions, DEFAULT_POP_API_PATHS, HttpSafeDropApiAdapter, type HttpSafeDropApiAdapterOptions, HttpXAuthAdapter, type HttpXAuthAdapterOptions, ONEPOP_ABI, type Pkce, type PopApiPaths, type PopEnvironment, SAFEDROP_ABI, SAFEDROP_VALIDATOR_ABI, type SessionStore, ViemClaimSignerAdapter, ViemCryptoAdapter, ViemSafeDropChainAdapter, type ViemSafeDropChainAdapterOptions, XAuthClient, type XAuthClientOptions, createSafeDropClient, generatePkce, generateState, getCrossAuthBaseUrl, getOnePopApiBaseUrl };
980
+ export { type CreateSafeDropClientOptions, CrossAuthClient, type CrossAuthClientOptions, DEFAULT_POP_API_PATHS, HttpSafeDropApiAdapter, type HttpSafeDropApiAdapterOptions, HttpXAuthAdapter, type HttpXAuthAdapterOptions, ONEPOP_ABI, ONE_POP_BPS_DENOMINATOR, ONE_POP_DEPLOYMENTS, ONE_POP_FEE_BPS, type Pkce, type PopApiPaths, type PopContracts, type PopDeployment, type PopEnvironment, SAFEDROP_ABI, SAFEDROP_VALIDATOR_ABI, type SafeDropTransactionFees, type SessionStore, ViemClaimSignerAdapter, ViemCryptoAdapter, ViemSafeDropChainAdapter, type ViemSafeDropChainAdapterOptions, XAuthClient, type XAuthClientOptions, createSafeDropClient, generatePkce, generateState, getCrossAuthBaseUrl, getOnePopApiBaseUrl, getOnePopContracts, getOnePopDeployment, getPopEnvironment };