@nexus-cross/pop 1.3.10-beta.2 → 1.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- import { S as SafeDropChainPort, a as SafeDropApiPort, C as CryptoPort, D as DepositParams, b as DepositResult, B as BatchClaimParams, c as BatchClaimResult, d as ClaimSignerPort, W as WithdrawParams, e as WithdrawResult, R as RefundParams, f as RefundResult, A as Address, g as Secret } from './createSafeDrop-qoNG59jB.js';
2
- export { h as BatchClaimSignature, i as DropInbox, j as DropSender, k as DropState, E as Envelope, H as Hex, l as HistoryEntry, m as HistoryPage, I as Id, L as LeaderboardEntry, O as OAuthProof, P as PendingDrop, n as PopEventName, o as SafeDrop, p as SafeDropConfig, q as SafeDropDeps, r as SafeDropError, s as SafeDropErrorCode, t as SecretHash, u as SocialIdentifier, v as SocialProvider, X as XConnection, w as createSafeDrop } from './createSafeDrop-qoNG59jB.js';
1
+ import { S as SafeDropChainPort, a as SafeDropApiPort, C as CryptoPort, D as DepositParams, b as DepositResult, B as BatchClaimParams, c as BatchClaimResult, d as ClaimSignerPort, W as WithdrawParams, e as WithdrawResult, R as RefundParams, f as RefundResult, A as Address, g as Secret } from './createSafeDrop-CayUX4w_.js';
2
+ export { h as BatchClaimSignature, i as DropInbox, j as DropSender, k as DropState, E as Envelope, H as Hex, l as HistoryEntry, m as HistoryPage, n as HistoryParty, o as HistoryType, I as Id, L as LeaderboardEntry, p as LeaderboardPage, M as MappedDepositResult, q as MyLeaderboardEntry, O as OAuthProof, r as OnePopDrop, P as PendingDrop, s as RecipientChangeSignature, t as RecipientSignature, u as SafeDrop, v as SafeDropConfig, w as SafeDropDeps, x as SafeDropError, y as SafeDropErrorCode, z as SecretHash, F as SocialIdentifier, G as SocialProvider, U as UnmappedDepositResult, X as XConnection, J as createSafeDrop } from './createSafeDrop-CayUX4w_.js';
3
3
  export { X as XAuthPort, a as XTokenResult } from './XAuthPort-BNJePosj.js';
4
4
 
5
5
  /**
6
- * 예치: 임시 claim 지갑 생성 → secretHash 커밋 → (permit | approve) → deposit →
7
- * 수령 링크 생성. chain 어댑터가 depositWithPermit을 구현하면 approve tx를 생략한다.
6
+ * 예치: 임시 claim 지갑 생성 → secretHash 커밋 → permit deposit → 수령 링크 생성.
8
7
  * secret은 링크 fragment에만 담기고 어떤 포트로도 전송되지 않는다.
9
- * (expiry/salt는 컨트랙트가 결정.)
10
8
  */
11
9
  declare class DepositUseCase {
12
10
  private readonly chain;
@@ -18,55 +16,22 @@ declare class DepositUseCase {
18
16
  /** 수령 링크 base URL. */
19
17
  claimBaseUrl: string);
20
18
  execute(params: DepositParams): Promise<DepositResult>;
21
- /** permit 미지원 배포본: ERC20 approve tx → deposit tx. */
22
- private approveThenDeposit;
23
19
  }
24
20
 
25
- /**
26
- * 일괄 수령: 한 id에 쌓인 드롭 전부를 validator 서명 1건으로 회수한다.
27
- * 개별 수령과 달리 secret이 필요 없다 — 게이트는 validator 서명이다.
28
- *
29
- * 흐름 (온체인 계약이 정한 순서 그대로):
30
- * 1. nonce = validatorNonceById(keccak256(utf8(id))) ← id를 **해시**로 키잉
31
- * 2. 백엔드에 (id, nonce, deadline) + X 토큰으로 서명 요청
32
- * → recipient는 **응답값**을 쓴다(SIWE 주소에 바인딩되어 서명됨)
33
- * 3. digest = validatorClaimDigest(recipient, id, nonce, deadline) ← 온체인 값
34
- * recover(digest, signature) == validator() 인지 **가스 전에** 검증
35
- * 4. liveDropCountById(id)이 0이 될 때까지 withdrawByValidator(..., maxCount, sig)
36
- * 반복. maxCount는 서명 대상이 아니라 페이지 크기 → **서명 재사용**.
37
- *
38
- * 3번이 이 usecase의 존재 이유다: 백엔드가 다른 domain/type/nonce/recipient로
39
- * 서명하면 온체인에서는 `ECDSAInvalidSignature`로만 드러나 원인을 못 찾는다.
40
- */
21
+ /** Current ONEpop batch flow: one anchor claim proves the secret, validator authorizes one batch call. */
41
22
  declare class BatchClaimUseCase {
42
23
  private readonly chain;
43
24
  private readonly api;
44
25
  private readonly crypto;
45
- /** 테스트 주입용 시계. 기본 Date.now(). */
46
26
  private readonly now;
47
- constructor(chain: SafeDropChainPort, api: SafeDropApiPort, crypto: CryptoPort,
48
- /** 테스트 주입용 시계. 기본 Date.now(). */
49
- now?: () => number);
27
+ constructor(chain: SafeDropChainPort, api: SafeDropApiPort, crypto: CryptoPort, now?: () => number);
50
28
  execute(params: BatchClaimParams): Promise<BatchClaimResult>;
51
- /**
52
- * 일괄 수령의 목적지가 **개별 수령으로 이미 확정된 주소**인지 온체인에서 확인한다.
53
- * `claimedRecipientOf(id)`가 zero면 이 id는 아직 개별 수령을 하지 않은 상태 —
54
- * API의 `has_claimed_before` 게이트와 같은 조건이다(첫 수령은 개별로).
55
- * 어댑터가 이 read를 지원하지 않으면 검사를 생략한다(플로우는 유지).
56
- */
57
- private assertRecipientPinnedOnChain;
58
- /**
59
- * 사전 검증. `recoverAddress`가 없는 CryptoPort면 조용히 건너뛴다 — 최종 관문은
60
- * 어차피 컨트랙트이고, 이 검사는 "가스 쓰기 전에 원인을 알려주는" 용도다.
61
- */
62
29
  private assertSignedByValidator;
63
- private liveCount;
64
30
  }
65
31
 
66
32
  /**
67
- * 수령: drops(claimAddr)에서 id·salt 조회 → claimDigest 읽기 → 임시 키로 digest
68
- * raw 서명 → withdraw tx(임시 지갑이 직접 전송, 가스 대납). id/salt는 온체인
69
- * 드롭 값을 그대로 써서 IdMismatch/SaltMismatch를 원천 차단한다.
33
+ * 수령: activeDropOf(claimAddr)로 dropKey를 찾고 온체인 id로 claimDigest를 서명한 뒤
34
+ * withdrawUnmapped를 호출한다.
70
35
  */
71
36
  declare class WithdrawUseCase {
72
37
  private readonly chain;
@@ -75,7 +40,7 @@ declare class WithdrawUseCase {
75
40
  execute(params: WithdrawParams): Promise<WithdrawResult>;
76
41
  }
77
42
 
78
- /** 환불: 만료 후 sponsor(msg.sender)만 호출 가능. 만료/권한 검증은 컨트랙트가 최종 강제. */
43
+ /** claim address를 현재 drop key로 해석해 sponsor 환불을 실행한다. */
79
44
  declare class RefundUseCase {
80
45
  private readonly chain;
81
46
  constructor(chain: SafeDropChainPort);
@@ -86,7 +51,8 @@ declare function buildWithdrawLink(params: {
86
51
  /** claim 페이지 base URL. 예: https://one-pop.example/claim */
87
52
  baseUrl: string;
88
53
  sender: Address;
89
- secret: Secret;
54
+ claimAddress?: Address;
55
+ secret?: Secret;
90
56
  }): string;
91
57
  declare function parseWithdrawLink(href: string): {
92
58
  sender: Address | null;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as r,b as e,c as o,d as t,e as p,f as a,g as s,h as i,i as f,j as m,k as n}from"./chunk-KEW4FB4S.js";export{i as BatchClaimUseCase,s as DepositUseCase,m as RefundUseCase,r as SafeDropError,f as WithdrawUseCase,a as buildComposeUrl,p as buildDmText,o as buildWithdrawLink,n as createSafeDrop,e as normalizeHandle,t as parseWithdrawLink};
1
+ import{a as r,b as e,c as o,d as t,e as p,f as a,g as s,h as i,i as f,j as n,k as m}from"./chunk-SE2HF5WH.js";export{i as BatchClaimUseCase,s as DepositUseCase,n as RefundUseCase,r as SafeDropError,f as WithdrawUseCase,a as buildComposeUrl,p as buildDmText,o as buildWithdrawLink,m as createSafeDrop,e as normalizeHandle,t as parseWithdrawLink};
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { o as SafeDrop } from '../createSafeDrop-qoNG59jB.js';
3
+ import { u as SafeDrop } from '../createSafeDrop-CayUX4w_.js';
4
4
 
5
5
  interface SafeDropProviderProps {
6
6
  client: SafeDrop;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cross/pop",
3
- "version": "1.3.10-beta.2",
3
+ "version": "1.4.0-beta.2",
4
4
  "description": "pop — framework-agnostic core + React adapter.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",