@frontiertower/frontier-sdk 0.11.2 → 0.12.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.
package/README.md CHANGED
@@ -30,12 +30,12 @@ if (!isInFrontierApp()) {
30
30
  // Access wallet information
31
31
  /**
32
32
  * The wallet balance is split into two types:
33
- * - Frontier Dollar (FTD): Freely convertible to fiat currency.
34
- * - Internal Frontier Dollar: Only convertible by Frontier Tower representatives;
33
+ * - Frontier Network Dollar (FND): Freely convertible to fiat currency.
34
+ * - Internal Frontier Network Dollar (iFND): Only convertible by Frontier Tower representatives;
35
35
  * designed for circulation within the Network Society.
36
36
  */
37
37
  const balance = await sdk.getWallet().getBalance();
38
- console.log('Total FTD:', balance.total.toString());
38
+ console.log('Total FND:', balance.total.toString());
39
39
  const address = await sdk.getWallet().getAddress();
40
40
 
41
41
  // Use persistent storage
@@ -58,12 +58,18 @@ Your app must declare required permissions in the Frontier app registry:
58
58
  - `wallet:transferNative` - Transfer native currency (ETH)
59
59
  - `wallet:transferFrontierDollar` - Transfer Frontier Dollars
60
60
  - `wallet:transferInternalFrontierDollar` - Transfer Internal Frontier Dollars
61
- - `wallet:transferOverallFrontierDollar` - Transfer Frontier Dollars with iFTD preferred
61
+ - `wallet:transferOverallFrontierDollar` - Transfer Frontier Dollars with iFND preferred
62
62
  - `wallet:executeCall` - Execute arbitrary contract calls
63
63
  - `wallet:executeBatchCall` - Execute multiple contract calls atomically
64
64
  - `wallet:getSupportedTokens` - Get list of supported tokens for swaps
65
65
  - `wallet:swap` - Execute token swaps (same-chain or cross-chain)
66
66
  - `wallet:quoteSwap` - Get quotes for token swaps
67
+ - `wallet:getUsdDepositInstructions` - Get USD bank deposit instructions for fiat on-ramp
68
+ - `wallet:getEurDepositInstructions` - Get EUR (SEPA) deposit instructions for fiat on-ramp
69
+ - `wallet:getLinkedBanks` - Get linked bank accounts for withdrawals (off-ramp)
70
+ - `wallet:linkUsBankAccount` - Link a US bank account for USD withdrawals
71
+ - `wallet:linkEuroAccount` - Link a EUR/IBAN bank account for EUR withdrawals
72
+ - `wallet:deleteLinkedBank` - Delete a linked bank account
67
73
 
68
74
  ### Storage Permissions
69
75
  - `storage:get` - Read from storage
@@ -77,6 +83,7 @@ Your app must declare required permissions in the Frontier app registry:
77
83
  - `user:getReferralOverview` - Access referral statistics
78
84
  - `user:getReferralDetails` - Access detailed referral information
79
85
  - `user:addUserContact` - Add user contact information
86
+ - `user:getOrCreateKyc` - Get or create KYC verification status
80
87
 
81
88
  ### Partnerships Permissions
82
89
  - `partnerships:listSponsors` - List sponsors you manage (paginated)
package/dist/index.d.mts CHANGED
@@ -23,12 +23,12 @@ interface SmartAccount {
23
23
  * Wallet balance breakdown
24
24
  */
25
25
  interface WalletBalance {
26
- /** Total balance including both native and internal FTD */
26
+ /** Total balance including both native and internal FND */
27
27
  total: bigint;
28
- /** Native Frontier Dollar balance */
29
- ftd: bigint;
30
- /** Internal Frontier Dollar balance (for Network Society) */
31
- internalFtd: bigint;
28
+ /** Native Frontier Network Dollar balance */
29
+ fnd: bigint;
30
+ /** Internal Frontier Network Dollar balance (for Network Society) */
31
+ internalFnd: bigint;
32
32
  }
33
33
  /**
34
34
  * Formatted wallet balance breakdown
@@ -36,10 +36,10 @@ interface WalletBalance {
36
36
  interface WalletBalanceFormatted {
37
37
  /** Total balance formatted with currency symbol */
38
38
  total: string;
39
- /** Native Frontier Dollar balance formatted with currency symbol */
40
- ftd: string;
41
- /** Internal Frontier Dollar balance formatted with currency symbol */
42
- internalFtd: string;
39
+ /** Native Frontier Network Dollar balance formatted with currency symbol */
40
+ fnd: string;
41
+ /** Internal Frontier Network Dollar balance formatted with currency symbol */
42
+ internalFnd: string;
43
43
  }
44
44
  /**
45
45
  * Transaction receipt from a user operation
@@ -130,6 +130,107 @@ interface SwapQuote {
130
130
  /** Minimum output amount in human-readable format */
131
131
  minAmountOut: string;
132
132
  }
133
+ /**
134
+ * USD deposit instructions for fiat on-ramp
135
+ */
136
+ interface UsdDepositInstructions {
137
+ /** Currency type */
138
+ currency: 'usd';
139
+ /** Bank name */
140
+ bankName: string;
141
+ /** Bank address */
142
+ bankAddress: string;
143
+ /** Bank routing number (ABA) */
144
+ bankRoutingNumber: string;
145
+ /** Bank account number */
146
+ bankAccountNumber: string;
147
+ /** Beneficiary name for the transfer */
148
+ bankBeneficiaryName: string;
149
+ /** Payment rail (e.g., 'ach', 'wire') */
150
+ paymentRail: string;
151
+ }
152
+ /**
153
+ * EUR deposit instructions for fiat on-ramp (SEPA)
154
+ */
155
+ interface EurDepositInstructions {
156
+ /** Currency type */
157
+ currency: 'eur';
158
+ /** IBAN for SEPA transfer */
159
+ iban: string;
160
+ /** BIC/SWIFT code */
161
+ bic: string;
162
+ /** Bank name */
163
+ bankName: string;
164
+ /** Beneficiary name for the transfer */
165
+ beneficiaryName: string;
166
+ }
167
+ /**
168
+ * Response containing deposit instructions for fiat on-ramp
169
+ */
170
+ interface OnRampResponse<T = UsdDepositInstructions | EurDepositInstructions> {
171
+ /** Currency type ('usd' or 'eur') */
172
+ currency: 'usd' | 'eur';
173
+ /** Deposit instructions specific to the currency */
174
+ depositInstructions: T;
175
+ /** Destination address where stablecoins will be sent */
176
+ destinationAddress: string;
177
+ }
178
+ /**
179
+ * Linked bank account for withdrawals (off-ramp)
180
+ */
181
+ interface LinkedBank {
182
+ /** External account ID */
183
+ id: string;
184
+ /** Bank name */
185
+ bankName: string;
186
+ /** Last 4 digits of account number */
187
+ last4: string;
188
+ /** Withdrawal address for this bank */
189
+ withdrawalAddress: string;
190
+ /** Chain for withdrawals */
191
+ chain: string;
192
+ }
193
+ /**
194
+ * Response containing linked bank accounts
195
+ */
196
+ interface LinkedBanksResponse {
197
+ /** List of linked bank accounts */
198
+ banks: LinkedBank[];
199
+ }
200
+ /**
201
+ * Response from linking a bank account
202
+ */
203
+ interface LinkBankResponse {
204
+ /** External account ID */
205
+ externalAccountId: string;
206
+ /** Bank name */
207
+ bankName: string;
208
+ /** Withdrawal address for this bank */
209
+ withdrawalAddress: string;
210
+ /** Chain for withdrawals */
211
+ chain: string;
212
+ }
213
+ /**
214
+ * Billing address for bank account linking
215
+ */
216
+ interface BillingAddress {
217
+ /** Street address line 1 */
218
+ streetLine1: string;
219
+ /** Street address line 2 (optional) */
220
+ streetLine2?: string;
221
+ /** City */
222
+ city: string;
223
+ /** State/Province */
224
+ state: string;
225
+ /** Postal/ZIP code */
226
+ postalCode: string;
227
+ /** Country code (e.g., 'USA') */
228
+ country: string;
229
+ }
230
+ /**
231
+ * Account owner type for IBAN accounts
232
+ */
233
+ type AccountOwnerType = 'individual' | 'business';
133
234
  /**
134
235
  * Wallet access class for interacting with the user's wallet
135
236
  *
@@ -148,8 +249,8 @@ declare class WalletAccess {
148
249
  /**
149
250
  * Get the current wallet balance breakdown
150
251
  *
151
- * Returns the balance breakdown including total, native FTD,
152
- * and internal FTD amounts.
252
+ * Returns the balance breakdown including total, native FND,
253
+ * and internal FND amounts.
153
254
  *
154
255
  * @returns Balance breakdown object
155
256
  * @throws {Error} If no wallet exists
@@ -158,7 +259,7 @@ declare class WalletAccess {
158
259
  * ```typescript
159
260
  * const balance = await sdk.getWallet().getBalance();
160
261
  * console.log('Total Balance:', balance.total.toString());
161
- * console.log('FTD Balance:', balance.ftd.toString());
262
+ * console.log('FND Balance:', balance.fnd.toString());
162
263
  * ```
163
264
  */
164
265
  getBalance(): Promise<WalletBalance>;
@@ -355,7 +456,7 @@ declare class WalletAccess {
355
456
  */
356
457
  transferInternalFrontierDollar(to: string, amount: string, overrides?: GasOverrides): Promise<UserOperationReceipt>;
357
458
  /**
358
- * Transfer Frontier Dollars with Internal Frontier Dollars (iFTD) preferred
459
+ * Transfer Frontier Dollars with Internal Frontier Network Dollars (iFND) preferred
359
460
  *
360
461
  * This method will use Internal Frontier Dollars first, and if insufficient,
361
462
  * it will use regular Frontier Dollars to complete the transfer.
@@ -411,12 +512,12 @@ declare class WalletAccess {
411
512
  * Returns an array of token symbols that are supported for swaps
412
513
  * and other operations on the current network.
413
514
  *
414
- * @returns Array of token symbols (e.g., ['FTD', 'USDC', 'WETH'])
515
+ * @returns Array of token symbols (e.g., ['FND', 'USDC', 'WETH'])
415
516
  *
416
517
  * @example
417
518
  * ```typescript
418
519
  * const tokens = await sdk.getWallet().getSupportedTokens();
419
- * console.log('Supported tokens:', tokens); // ['FTD', 'USDC', 'WETH']
520
+ * console.log('Supported tokens:', tokens); // ['FND', 'USDC', 'WETH']
420
521
  * ```
421
522
  */
422
523
  getSupportedTokens(): Promise<string[]>;
@@ -472,6 +573,153 @@ declare class WalletAccess {
472
573
  * ```
473
574
  */
474
575
  quoteSwap(sourceToken: string, targetToken: string, sourceNetwork: string, targetNetwork: string, amount: string): Promise<SwapQuote>;
576
+ /**
577
+ * Get USD deposit instructions for fiat on-ramp
578
+ *
579
+ * Returns US bank details where user should send their USD deposit.
580
+ * The deposited fiat will be converted to stablecoins and sent to
581
+ * the user's wallet address.
582
+ *
583
+ * Requires approved KYC verification.
584
+ *
585
+ * @returns Bank details including routing number, account number, and beneficiary info
586
+ * @throws {Error} If KYC is not approved
587
+ *
588
+ * @example
589
+ * ```typescript
590
+ * const instructions = await sdk.getWallet().getUsdDepositInstructions();
591
+ * console.log('Bank:', instructions.depositInstructions.bankName);
592
+ * console.log('Routing:', instructions.depositInstructions.bankRoutingNumber);
593
+ * console.log('Account:', instructions.depositInstructions.bankAccountNumber);
594
+ * console.log('Beneficiary:', instructions.depositInstructions.bankBeneficiaryName);
595
+ * ```
596
+ */
597
+ getUsdDepositInstructions(): Promise<OnRampResponse<UsdDepositInstructions>>;
598
+ /**
599
+ * Get EUR deposit instructions for fiat on-ramp (SEPA)
600
+ *
601
+ * Returns SEPA bank details where user should send their EUR deposit.
602
+ * The deposited fiat will be converted to stablecoins and sent to
603
+ * the user's wallet address.
604
+ *
605
+ * Requires approved KYC verification.
606
+ *
607
+ * @returns SEPA bank details including IBAN, BIC, and beneficiary info
608
+ * @throws {Error} If KYC is not approved
609
+ *
610
+ * @example
611
+ * ```typescript
612
+ * const instructions = await sdk.getWallet().getEurDepositInstructions();
613
+ * console.log('IBAN:', instructions.depositInstructions.iban);
614
+ * console.log('BIC:', instructions.depositInstructions.bic);
615
+ * console.log('Bank:', instructions.depositInstructions.bankName);
616
+ * console.log('Beneficiary:', instructions.depositInstructions.beneficiaryName);
617
+ * ```
618
+ */
619
+ getEurDepositInstructions(): Promise<OnRampResponse<EurDepositInstructions>>;
620
+ /**
621
+ * Get all linked bank accounts for withdrawals (off-ramp)
622
+ *
623
+ * Returns a list of bank accounts that have been linked for
624
+ * withdrawing stablecoins to fiat.
625
+ *
626
+ * Requires approved KYC verification.
627
+ *
628
+ * @returns List of linked bank accounts with withdrawal addresses
629
+ * @throws {Error} If KYC is not approved
630
+ *
631
+ * @example
632
+ * ```typescript
633
+ * const { banks } = await sdk.getWallet().getLinkedBanks();
634
+ * banks.forEach(bank => {
635
+ * console.log(`${bank.bankName} (****${bank.last4})`);
636
+ * });
637
+ * ```
638
+ */
639
+ getLinkedBanks(): Promise<LinkedBanksResponse>;
640
+ /**
641
+ * Link a US bank account for withdrawals (off-ramp)
642
+ *
643
+ * Links a US bank account (checking or savings) for withdrawing
644
+ * stablecoins to USD via ACH transfer.
645
+ *
646
+ * Requires approved KYC verification.
647
+ *
648
+ * @param accountOwnerName - Full name of the account owner
649
+ * @param bankName - Name of the bank (e.g., 'Chase', 'Bank of America')
650
+ * @param routingNumber - Bank routing number (9 digits)
651
+ * @param accountNumber - Bank account number
652
+ * @param checkingOrSavings - Account type: 'checking' or 'savings'
653
+ * @param address - Billing address for the account
654
+ * @returns Linked bank details with withdrawal address
655
+ * @throws {Error} If KYC is not approved or bank details are invalid
656
+ *
657
+ * @example
658
+ * ```typescript
659
+ * const result = await sdk.getWallet().linkUsBankAccount(
660
+ * 'John Doe',
661
+ * 'Chase',
662
+ * '121000248',
663
+ * '1234567890',
664
+ * 'checking',
665
+ * {
666
+ * streetLine1: '123 Main St',
667
+ * city: 'San Francisco',
668
+ * state: 'CA',
669
+ * postalCode: '94102',
670
+ * country: 'USA'
671
+ * }
672
+ * );
673
+ * console.log('Linked bank:', result.bankName);
674
+ * ```
675
+ */
676
+ linkUsBankAccount(accountOwnerName: string, bankName: string, routingNumber: string, accountNumber: string, checkingOrSavings: 'checking' | 'savings', address: BillingAddress): Promise<LinkBankResponse>;
677
+ /**
678
+ * Link a EUR/IBAN bank account for withdrawals (off-ramp)
679
+ *
680
+ * Links a European bank account via IBAN for withdrawing
681
+ * stablecoins to EUR via SEPA transfer.
682
+ *
683
+ * Requires approved KYC verification.
684
+ *
685
+ * @param accountOwnerName - Full name of the account owner
686
+ * @param accountOwnerType - Type of account owner: 'individual' or 'business'
687
+ * @param firstName - First name of the account owner
688
+ * @param lastName - Last name of the account owner
689
+ * @param ibanAccountNumber - IBAN account number
690
+ * @param bic - Optional BIC/SWIFT code
691
+ * @returns Linked bank details with withdrawal address
692
+ * @throws {Error} If KYC is not approved or bank details are invalid
693
+ *
694
+ * @example
695
+ * ```typescript
696
+ * const result = await sdk.getWallet().linkEuroAccount(
697
+ * 'Hans Mueller',
698
+ * 'individual',
699
+ * 'Hans',
700
+ * 'Mueller',
701
+ * 'DE89370400440532013000',
702
+ * 'COBADEFFXXX' // optional BIC
703
+ * );
704
+ * console.log('Linked bank:', result.bankName);
705
+ * ```
706
+ */
707
+ linkEuroAccount(accountOwnerName: string, accountOwnerType: AccountOwnerType, firstName: string, lastName: string, ibanAccountNumber: string, bic?: string): Promise<LinkBankResponse>;
708
+ /**
709
+ * Delete a linked bank account
710
+ *
711
+ * Removes a previously linked bank account from the user's off-ramp options.
712
+ *
713
+ * @param bankId - The ID of the linked bank account to delete
714
+ * @throws {Error} If the bank account doesn't exist or deletion fails
715
+ *
716
+ * @example
717
+ * ```typescript
718
+ * await sdk.getWallet().deleteLinkedBank('bank_abc123');
719
+ * console.log('Bank account deleted');
720
+ * ```
721
+ */
722
+ deleteLinkedBank(bankId: string): Promise<void>;
475
723
  }
476
724
 
477
725
  /**
@@ -767,6 +1015,33 @@ interface UserContact {
767
1015
  /** Contact name */
768
1016
  name: string;
769
1017
  }
1018
+ /**
1019
+ * KYC verification status
1020
+ */
1021
+ type KycStatus = 'not_started' | 'pending' | 'in_review' | 'approved' | 'rejected';
1022
+ /**
1023
+ * Terms of Service acceptance status
1024
+ */
1025
+ type TosStatus = 'pending' | 'approved';
1026
+ /**
1027
+ * KYC status response
1028
+ */
1029
+ interface KycStatusResponse {
1030
+ /** Current KYC status */
1031
+ status: KycStatus;
1032
+ /** Whether KYC is approved */
1033
+ isApproved: boolean;
1034
+ /** Reason for rejection (if rejected) */
1035
+ rejectionReason: string | null;
1036
+ /** KYC link ID (if KYC has been started) */
1037
+ kycLinkId: string | null;
1038
+ /** URL to complete KYC verification (if KYC has been started) */
1039
+ kycLinkUrl: string | null;
1040
+ /** Terms of Service acceptance status */
1041
+ tosStatus: TosStatus | null;
1042
+ /** URL to accept Terms of Service */
1043
+ tosLink: string | null;
1044
+ }
770
1045
  /**
771
1046
  * User contact information payload
772
1047
  */
@@ -882,6 +1157,31 @@ declare class UserAccess {
882
1157
  * ```
883
1158
  */
884
1159
  addUserContact(data: UserContactPayload): Promise<void>;
1160
+ /**
1161
+ * Get or create KYC status
1162
+ *
1163
+ * Returns the current KYC verification status. If KYC has not been started,
1164
+ * it will be initiated and the response will include a URL to complete verification.
1165
+ *
1166
+ * @param redirectUri - Optional URL to redirect user after KYC completion
1167
+ * @returns KycStatusResponse with status and verification link if applicable
1168
+ * @throws {Error} If user is not authenticated
1169
+ *
1170
+ * @example
1171
+ * ```typescript
1172
+ * const kyc = await sdk.getUser().getOrCreateKyc();
1173
+ * if (kyc.status === 'not_started' && kyc.kycLinkUrl) {
1174
+ * // Redirect user to complete KYC
1175
+ * window.open(kyc.kycLinkUrl, '_blank');
1176
+ * } else if (kyc.isApproved) {
1177
+ * console.log('KYC approved!');
1178
+ * }
1179
+ *
1180
+ * // With redirect URI
1181
+ * const kycWithRedirect = await sdk.getUser().getOrCreateKyc('https://myapp.com/callback');
1182
+ * ```
1183
+ */
1184
+ getOrCreateKyc(redirectUri?: string): Promise<KycStatusResponse>;
885
1185
  }
886
1186
 
887
1187
  /**
@@ -1598,4 +1898,4 @@ interface SDKResponse {
1598
1898
  error?: string;
1599
1899
  }
1600
1900
 
1601
- export { type App, type AppPermission, type AppStatus, ChainAccess, type ChainConfig, type CreateAppRequest, type CreateSponsorPassRequest, type CreateWebhookRequest, type Developer, type ExecuteCall, FrontierSDK, type GasOverrides, type ListParams, type ListSponsorsParams, type PaginatedResponse, PartnershipsAccess, type ReferralDetails, type ReferralOverview, type RotateKeyResponse, type RotateWebhookKeyResponse, type SDKRequest, type SDKResponse, type SmartAccount, type Sponsor, type SponsorPass, type StableCoin, StorageAccess, type SwapParams, type SwapQuote, type SwapResult, SwapResultStatus, ThirdPartyAccess, type Token, Underlying, type UpdateAppRequest, type UpdateDeveloperRequest, type UpdateWebhookRequest, type User, UserAccess, type UserContact, type UserContactPayload, type UserOperationReceipt, type UserProfile, WalletAccess, type WalletBalance, type WalletBalanceFormatted, type Webhook, type WebhookConfig, type WebhookEvent, type WebhookScope, type WebhookStatus };
1901
+ export { type AccountOwnerType, type App, type AppPermission, type AppStatus, type BillingAddress, ChainAccess, type ChainConfig, type CreateAppRequest, type CreateSponsorPassRequest, type CreateWebhookRequest, type Developer, type EurDepositInstructions, type ExecuteCall, FrontierSDK, type GasOverrides, type LinkBankResponse, type LinkedBank, type LinkedBanksResponse, type ListParams, type ListSponsorsParams, type OnRampResponse, type PaginatedResponse, PartnershipsAccess, type ReferralDetails, type ReferralOverview, type RotateKeyResponse, type RotateWebhookKeyResponse, type SDKRequest, type SDKResponse, type SmartAccount, type Sponsor, type SponsorPass, type StableCoin, StorageAccess, type SwapParams, type SwapQuote, type SwapResult, SwapResultStatus, ThirdPartyAccess, type Token, Underlying, type UpdateAppRequest, type UpdateDeveloperRequest, type UpdateWebhookRequest, type UsdDepositInstructions, type User, UserAccess, type UserContact, type UserContactPayload, type UserOperationReceipt, type UserProfile, WalletAccess, type WalletBalance, type WalletBalanceFormatted, type Webhook, type WebhookConfig, type WebhookEvent, type WebhookScope, type WebhookStatus };