@weblock-wallet/sdk 0.1.52 → 0.1.54

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.cts CHANGED
@@ -36,62 +36,6 @@ declare class SDKError extends Error {
36
36
  constructor(message: string, code: SDKErrorCode, details?: unknown | undefined);
37
37
  }
38
38
 
39
- interface GetOfferingParams {
40
- networkId: string;
41
- saleRouterAddress: string;
42
- offeringId: bigint | number | string;
43
- }
44
- interface OfferingView {
45
- asset: string;
46
- seriesId: bigint;
47
- unitPrice: bigint;
48
- remainingUnits: bigint;
49
- startAt: bigint;
50
- endAt: bigint;
51
- treasury: string;
52
- enabled: boolean;
53
- }
54
- interface InvestRbtParams {
55
- networkId: string;
56
- usdrAddress: string;
57
- saleRouterAddress: string;
58
- offeringId: bigint | number | string;
59
- units: bigint | number | string;
60
- /**
61
- * 보호용 상한(슬리피지 개념). 미지정 시 cost == maxCost로 처리.
62
- */
63
- maxCostWei?: string;
64
- /**
65
- * true면 allowance 확인 후 부족 시 approve까지 자동 수행
66
- */
67
- autoApprove?: boolean;
68
- /**
69
- * autoApprove일 때 approve를 MaxUint로 할지(cost만 할지)
70
- */
71
- approveMax?: boolean;
72
- /**
73
- * autoApprove에서 approve tx 영수증을 기다릴지(기본 true 권장)
74
- */
75
- waitForApprovalReceipt?: boolean;
76
- gasLimitApprove?: string;
77
- gasLimitBuy?: string;
78
- }
79
- interface InvestRbtResult {
80
- offering: OfferingView;
81
- costWei: string;
82
- approvalTxHash?: string;
83
- purchaseTxHash: string;
84
- }
85
- interface ClaimRbtRevenueParams {
86
- networkId: string;
87
- rbtAssetAddress: string;
88
- seriesId: bigint | number | string;
89
- gasLimit?: string;
90
- }
91
- interface ClaimRbtRevenueResult {
92
- txHash: string;
93
- }
94
-
95
39
  /**
96
40
  * SDK 초기화 옵션
97
41
  */
@@ -372,6 +316,35 @@ interface TokenInfoParams {
372
316
  networkId: string;
373
317
  tokenAddress: string;
374
318
  }
319
+ /**
320
+ * ERC-1155 balanceOf params
321
+ */
322
+ interface ERC1155BalanceParams {
323
+ networkId: string;
324
+ tokenAddress: string;
325
+ walletAddress: string;
326
+ tokenId: string | number;
327
+ }
328
+ /**
329
+ * RBTPropertyToken claimable() params
330
+ */
331
+ interface RbtClaimableParams {
332
+ networkId: string;
333
+ tokenAddress: string;
334
+ walletAddress: string;
335
+ tokenId: string | number;
336
+ }
337
+ /**
338
+ * RBTPropertyToken claim() params
339
+ */
340
+ interface RbtClaimParams {
341
+ networkId: string;
342
+ tokenAddress: string;
343
+ tokenId: string | number;
344
+ gasLimit?: string;
345
+ gasPrice?: string;
346
+ nonce?: number;
347
+ }
375
348
  interface SendTransactionParams {
376
349
  to: string;
377
350
  value: string;
@@ -468,7 +441,6 @@ declare class WeBlockSDK {
468
441
  private readonly walletModule;
469
442
  private readonly assetModule;
470
443
  private readonly networkModule;
471
- private readonly investmentModule;
472
444
  private initialized;
473
445
  constructor(options: SDKOptions);
474
446
  private validateOptions;
@@ -522,6 +494,12 @@ declare class WeBlockSDK {
522
494
  on: (event: string, listener: (...args: any[]) => void) => void;
523
495
  off: (event: string, listener: (...args: any[]) => void) => void;
524
496
  getTokenInfo: (params: TokenInfoParams) => Promise<TokenMetadata>;
497
+ getTokenBalance: (params: TokenBalanceParams) => Promise<string>;
498
+ approveToken: (params: TokenApprovalParams) => Promise<string>;
499
+ getAllowance: (params: TokenAllowanceParams) => Promise<string>;
500
+ getERC1155Balance: (params: ERC1155BalanceParams) => Promise<string>;
501
+ getRbtClaimable: (params: RbtClaimableParams) => Promise<string>;
502
+ claimRbt: (params: RbtClaimParams) => Promise<string>;
525
503
  registerToken: (params: {
526
504
  networkId: string;
527
505
  tokenAddress: string;
@@ -531,36 +509,7 @@ declare class WeBlockSDK {
531
509
  tokenAddress: string;
532
510
  walletAddress: string;
533
511
  }) => Promise<TokenInfo>;
534
- /**
535
- * ✅ ERC20 잔액 조회 (주의: 현재 AssetModule 구현은 raw balance string을 반환)
536
- * - TokenBalance(객체)가 아니라 string(wei) 입니다.
537
- */
538
- getTokenBalance: (params: TokenBalanceParams) => Promise<string>;
539
- approveToken: (params: TokenApprovalParams) => Promise<string>;
540
- getAllowance: (params: TokenAllowanceParams) => Promise<string>;
541
- };
542
- /**
543
- * ✅ NEW: Investment API Surface
544
- */
545
- readonly invest: {
546
- getOffering: (params: GetOfferingParams) => Promise<OfferingView>;
547
- investRbtWithUsdr: (params: InvestRbtParams) => Promise<InvestRbtResult>;
548
- claimRbtRevenue: (params: ClaimRbtRevenueParams) => Promise<ClaimRbtRevenueResult>;
549
- getClaimable: (params: {
550
- networkId: string;
551
- rbtAssetAddress: string;
552
- seriesId: bigint | number | string;
553
- account?: string;
554
- }) => Promise<string>;
555
- getRbtBalance: (params: {
556
- networkId: string;
557
- rbtAssetAddress: string;
558
- seriesId: bigint | number | string;
559
- account?: string;
560
- }) => Promise<string>;
561
- on: (event: string, listener: (...args: any[]) => void) => void;
562
- off: (event: string, listener: (...args: any[]) => void) => void;
563
512
  };
564
513
  }
565
514
 
566
- export { type AddNetworkRequest, type ClaimRbtRevenueParams, type ClaimRbtRevenueResult, DECIMALS, type GetOfferingParams, type InvestRbtParams, type InvestRbtResult, type NFTCollection, type NetworkInfo, type OfferingView, SDKError, SDKErrorCode, type SDKOptions, type SecurityTokenInfo, type SendTransactionParams, type SignInResponse, SignInStatus, type SwitchNetworkResponse, type TokenAllowanceParams, TokenAmount, type TokenApprovalParams, type TokenBalance, type TokenBalanceParams, type TokenInfo, type TokenInfoParams, type TokenMetadata, TokenType, type Transaction, type TransactionReceipt, TransactionStatus, type TransactionStatusEvent, TransactionType, type TransferRequest, type TransferResponse, type WalletInfo, type WalletResponse, WeBlockSDK, WeBlockSDK as default };
515
+ export { type AddNetworkRequest, DECIMALS, type ERC1155BalanceParams, type NFTCollection, type NetworkInfo, type RbtClaimParams, type RbtClaimableParams, SDKError, SDKErrorCode, type SDKOptions, type SecurityTokenInfo, type SendTransactionParams, type SignInResponse, SignInStatus, type SwitchNetworkResponse, type TokenAllowanceParams, TokenAmount, type TokenApprovalParams, type TokenBalance, type TokenBalanceParams, type TokenInfo, type TokenInfoParams, type TokenMetadata, TokenType, type Transaction, type TransactionReceipt, TransactionStatus, type TransactionStatusEvent, TransactionType, type TransferRequest, type TransferResponse, type WalletInfo, type WalletResponse, WeBlockSDK, WeBlockSDK as default };
package/dist/index.d.ts CHANGED
@@ -36,62 +36,6 @@ declare class SDKError extends Error {
36
36
  constructor(message: string, code: SDKErrorCode, details?: unknown | undefined);
37
37
  }
38
38
 
39
- interface GetOfferingParams {
40
- networkId: string;
41
- saleRouterAddress: string;
42
- offeringId: bigint | number | string;
43
- }
44
- interface OfferingView {
45
- asset: string;
46
- seriesId: bigint;
47
- unitPrice: bigint;
48
- remainingUnits: bigint;
49
- startAt: bigint;
50
- endAt: bigint;
51
- treasury: string;
52
- enabled: boolean;
53
- }
54
- interface InvestRbtParams {
55
- networkId: string;
56
- usdrAddress: string;
57
- saleRouterAddress: string;
58
- offeringId: bigint | number | string;
59
- units: bigint | number | string;
60
- /**
61
- * 보호용 상한(슬리피지 개념). 미지정 시 cost == maxCost로 처리.
62
- */
63
- maxCostWei?: string;
64
- /**
65
- * true면 allowance 확인 후 부족 시 approve까지 자동 수행
66
- */
67
- autoApprove?: boolean;
68
- /**
69
- * autoApprove일 때 approve를 MaxUint로 할지(cost만 할지)
70
- */
71
- approveMax?: boolean;
72
- /**
73
- * autoApprove에서 approve tx 영수증을 기다릴지(기본 true 권장)
74
- */
75
- waitForApprovalReceipt?: boolean;
76
- gasLimitApprove?: string;
77
- gasLimitBuy?: string;
78
- }
79
- interface InvestRbtResult {
80
- offering: OfferingView;
81
- costWei: string;
82
- approvalTxHash?: string;
83
- purchaseTxHash: string;
84
- }
85
- interface ClaimRbtRevenueParams {
86
- networkId: string;
87
- rbtAssetAddress: string;
88
- seriesId: bigint | number | string;
89
- gasLimit?: string;
90
- }
91
- interface ClaimRbtRevenueResult {
92
- txHash: string;
93
- }
94
-
95
39
  /**
96
40
  * SDK 초기화 옵션
97
41
  */
@@ -372,6 +316,35 @@ interface TokenInfoParams {
372
316
  networkId: string;
373
317
  tokenAddress: string;
374
318
  }
319
+ /**
320
+ * ERC-1155 balanceOf params
321
+ */
322
+ interface ERC1155BalanceParams {
323
+ networkId: string;
324
+ tokenAddress: string;
325
+ walletAddress: string;
326
+ tokenId: string | number;
327
+ }
328
+ /**
329
+ * RBTPropertyToken claimable() params
330
+ */
331
+ interface RbtClaimableParams {
332
+ networkId: string;
333
+ tokenAddress: string;
334
+ walletAddress: string;
335
+ tokenId: string | number;
336
+ }
337
+ /**
338
+ * RBTPropertyToken claim() params
339
+ */
340
+ interface RbtClaimParams {
341
+ networkId: string;
342
+ tokenAddress: string;
343
+ tokenId: string | number;
344
+ gasLimit?: string;
345
+ gasPrice?: string;
346
+ nonce?: number;
347
+ }
375
348
  interface SendTransactionParams {
376
349
  to: string;
377
350
  value: string;
@@ -468,7 +441,6 @@ declare class WeBlockSDK {
468
441
  private readonly walletModule;
469
442
  private readonly assetModule;
470
443
  private readonly networkModule;
471
- private readonly investmentModule;
472
444
  private initialized;
473
445
  constructor(options: SDKOptions);
474
446
  private validateOptions;
@@ -522,6 +494,12 @@ declare class WeBlockSDK {
522
494
  on: (event: string, listener: (...args: any[]) => void) => void;
523
495
  off: (event: string, listener: (...args: any[]) => void) => void;
524
496
  getTokenInfo: (params: TokenInfoParams) => Promise<TokenMetadata>;
497
+ getTokenBalance: (params: TokenBalanceParams) => Promise<string>;
498
+ approveToken: (params: TokenApprovalParams) => Promise<string>;
499
+ getAllowance: (params: TokenAllowanceParams) => Promise<string>;
500
+ getERC1155Balance: (params: ERC1155BalanceParams) => Promise<string>;
501
+ getRbtClaimable: (params: RbtClaimableParams) => Promise<string>;
502
+ claimRbt: (params: RbtClaimParams) => Promise<string>;
525
503
  registerToken: (params: {
526
504
  networkId: string;
527
505
  tokenAddress: string;
@@ -531,36 +509,7 @@ declare class WeBlockSDK {
531
509
  tokenAddress: string;
532
510
  walletAddress: string;
533
511
  }) => Promise<TokenInfo>;
534
- /**
535
- * ✅ ERC20 잔액 조회 (주의: 현재 AssetModule 구현은 raw balance string을 반환)
536
- * - TokenBalance(객체)가 아니라 string(wei) 입니다.
537
- */
538
- getTokenBalance: (params: TokenBalanceParams) => Promise<string>;
539
- approveToken: (params: TokenApprovalParams) => Promise<string>;
540
- getAllowance: (params: TokenAllowanceParams) => Promise<string>;
541
- };
542
- /**
543
- * ✅ NEW: Investment API Surface
544
- */
545
- readonly invest: {
546
- getOffering: (params: GetOfferingParams) => Promise<OfferingView>;
547
- investRbtWithUsdr: (params: InvestRbtParams) => Promise<InvestRbtResult>;
548
- claimRbtRevenue: (params: ClaimRbtRevenueParams) => Promise<ClaimRbtRevenueResult>;
549
- getClaimable: (params: {
550
- networkId: string;
551
- rbtAssetAddress: string;
552
- seriesId: bigint | number | string;
553
- account?: string;
554
- }) => Promise<string>;
555
- getRbtBalance: (params: {
556
- networkId: string;
557
- rbtAssetAddress: string;
558
- seriesId: bigint | number | string;
559
- account?: string;
560
- }) => Promise<string>;
561
- on: (event: string, listener: (...args: any[]) => void) => void;
562
- off: (event: string, listener: (...args: any[]) => void) => void;
563
512
  };
564
513
  }
565
514
 
566
- export { type AddNetworkRequest, type ClaimRbtRevenueParams, type ClaimRbtRevenueResult, DECIMALS, type GetOfferingParams, type InvestRbtParams, type InvestRbtResult, type NFTCollection, type NetworkInfo, type OfferingView, SDKError, SDKErrorCode, type SDKOptions, type SecurityTokenInfo, type SendTransactionParams, type SignInResponse, SignInStatus, type SwitchNetworkResponse, type TokenAllowanceParams, TokenAmount, type TokenApprovalParams, type TokenBalance, type TokenBalanceParams, type TokenInfo, type TokenInfoParams, type TokenMetadata, TokenType, type Transaction, type TransactionReceipt, TransactionStatus, type TransactionStatusEvent, TransactionType, type TransferRequest, type TransferResponse, type WalletInfo, type WalletResponse, WeBlockSDK, WeBlockSDK as default };
515
+ export { type AddNetworkRequest, DECIMALS, type ERC1155BalanceParams, type NFTCollection, type NetworkInfo, type RbtClaimParams, type RbtClaimableParams, SDKError, SDKErrorCode, type SDKOptions, type SecurityTokenInfo, type SendTransactionParams, type SignInResponse, SignInStatus, type SwitchNetworkResponse, type TokenAllowanceParams, TokenAmount, type TokenApprovalParams, type TokenBalance, type TokenBalanceParams, type TokenInfo, type TokenInfoParams, type TokenMetadata, TokenType, type Transaction, type TransactionReceipt, TransactionStatus, type TransactionStatusEvent, TransactionType, type TransferRequest, type TransferResponse, type WalletInfo, type WalletResponse, WeBlockSDK, WeBlockSDK as default };