@frontiertower/frontier-sdk 0.11.2 → 0.13.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,109 @@ 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
+ /** Destination network */
178
+ destinationNetwork: string;
179
+ }
180
+ /**
181
+ * Linked bank account for withdrawals (off-ramp)
182
+ */
183
+ interface LinkedBank {
184
+ /** External account ID */
185
+ id: string;
186
+ /** Bank name */
187
+ bankName: string;
188
+ /** Last 4 digits of account number */
189
+ last4: string;
190
+ /** Withdrawal address for this bank */
191
+ withdrawalAddress: string;
192
+ /** Network for withdrawals */
193
+ network: string;
194
+ }
195
+ /**
196
+ * Response containing linked bank accounts
197
+ */
198
+ interface LinkedBanksResponse {
199
+ /** List of linked bank accounts */
200
+ banks: LinkedBank[];
201
+ }
202
+ /**
203
+ * Response from linking a bank account
204
+ */
205
+ interface LinkBankResponse {
206
+ /** External account ID */
207
+ externalAccountId: string;
208
+ /** Bank name */
209
+ bankName: string;
210
+ /** Withdrawal address for this bank */
211
+ withdrawalAddress: string;
212
+ /** Network for withdrawals */
213
+ network: string;
214
+ }
215
+ /**
216
+ * Billing address for bank account linking
217
+ */
218
+ interface BillingAddress {
219
+ /** Street address line 1 */
220
+ streetLine1: string;
221
+ /** Street address line 2 (optional) */
222
+ streetLine2?: string;
223
+ /** City */
224
+ city: string;
225
+ /** State/Province */
226
+ state: string;
227
+ /** Postal/ZIP code */
228
+ postalCode: string;
229
+ /** Country code (e.g., 'USA') */
230
+ country: string;
231
+ }
232
+ /**
233
+ * Account owner type for IBAN accounts
234
+ */
235
+ type AccountOwnerType = 'individual' | 'business';
133
236
  /**
134
237
  * Wallet access class for interacting with the user's wallet
135
238
  *
@@ -148,8 +251,8 @@ declare class WalletAccess {
148
251
  /**
149
252
  * Get the current wallet balance breakdown
150
253
  *
151
- * Returns the balance breakdown including total, native FTD,
152
- * and internal FTD amounts.
254
+ * Returns the balance breakdown including total, native FND,
255
+ * and internal FND amounts.
153
256
  *
154
257
  * @returns Balance breakdown object
155
258
  * @throws {Error} If no wallet exists
@@ -158,7 +261,7 @@ declare class WalletAccess {
158
261
  * ```typescript
159
262
  * const balance = await sdk.getWallet().getBalance();
160
263
  * console.log('Total Balance:', balance.total.toString());
161
- * console.log('FTD Balance:', balance.ftd.toString());
264
+ * console.log('FND Balance:', balance.fnd.toString());
162
265
  * ```
163
266
  */
164
267
  getBalance(): Promise<WalletBalance>;
@@ -355,7 +458,7 @@ declare class WalletAccess {
355
458
  */
356
459
  transferInternalFrontierDollar(to: string, amount: string, overrides?: GasOverrides): Promise<UserOperationReceipt>;
357
460
  /**
358
- * Transfer Frontier Dollars with Internal Frontier Dollars (iFTD) preferred
461
+ * Transfer Frontier Dollars with Internal Frontier Network Dollars (iFND) preferred
359
462
  *
360
463
  * This method will use Internal Frontier Dollars first, and if insufficient,
361
464
  * it will use regular Frontier Dollars to complete the transfer.
@@ -411,12 +514,12 @@ declare class WalletAccess {
411
514
  * Returns an array of token symbols that are supported for swaps
412
515
  * and other operations on the current network.
413
516
  *
414
- * @returns Array of token symbols (e.g., ['FTD', 'USDC', 'WETH'])
517
+ * @returns Array of token symbols (e.g., ['FND', 'USDC', 'WETH'])
415
518
  *
416
519
  * @example
417
520
  * ```typescript
418
521
  * const tokens = await sdk.getWallet().getSupportedTokens();
419
- * console.log('Supported tokens:', tokens); // ['FTD', 'USDC', 'WETH']
522
+ * console.log('Supported tokens:', tokens); // ['FND', 'USDC', 'WETH']
420
523
  * ```
421
524
  */
422
525
  getSupportedTokens(): Promise<string[]>;
@@ -472,6 +575,153 @@ declare class WalletAccess {
472
575
  * ```
473
576
  */
474
577
  quoteSwap(sourceToken: string, targetToken: string, sourceNetwork: string, targetNetwork: string, amount: string): Promise<SwapQuote>;
578
+ /**
579
+ * Get USD deposit instructions for fiat on-ramp
580
+ *
581
+ * Returns US bank details where user should send their USD deposit.
582
+ * The deposited fiat will be converted to stablecoins and sent to
583
+ * the user's wallet address.
584
+ *
585
+ * Requires approved KYC verification.
586
+ *
587
+ * @returns Bank details including routing number, account number, and beneficiary info
588
+ * @throws {Error} If KYC is not approved
589
+ *
590
+ * @example
591
+ * ```typescript
592
+ * const instructions = await sdk.getWallet().getUsdDepositInstructions();
593
+ * console.log('Bank:', instructions.depositInstructions.bankName);
594
+ * console.log('Routing:', instructions.depositInstructions.bankRoutingNumber);
595
+ * console.log('Account:', instructions.depositInstructions.bankAccountNumber);
596
+ * console.log('Beneficiary:', instructions.depositInstructions.bankBeneficiaryName);
597
+ * ```
598
+ */
599
+ getUsdDepositInstructions(): Promise<OnRampResponse<UsdDepositInstructions>>;
600
+ /**
601
+ * Get EUR deposit instructions for fiat on-ramp (SEPA)
602
+ *
603
+ * Returns SEPA bank details where user should send their EUR deposit.
604
+ * The deposited fiat will be converted to stablecoins and sent to
605
+ * the user's wallet address.
606
+ *
607
+ * Requires approved KYC verification.
608
+ *
609
+ * @returns SEPA bank details including IBAN, BIC, and beneficiary info
610
+ * @throws {Error} If KYC is not approved
611
+ *
612
+ * @example
613
+ * ```typescript
614
+ * const instructions = await sdk.getWallet().getEurDepositInstructions();
615
+ * console.log('IBAN:', instructions.depositInstructions.iban);
616
+ * console.log('BIC:', instructions.depositInstructions.bic);
617
+ * console.log('Bank:', instructions.depositInstructions.bankName);
618
+ * console.log('Beneficiary:', instructions.depositInstructions.beneficiaryName);
619
+ * ```
620
+ */
621
+ getEurDepositInstructions(): Promise<OnRampResponse<EurDepositInstructions>>;
622
+ /**
623
+ * Get all linked bank accounts for withdrawals (off-ramp)
624
+ *
625
+ * Returns a list of bank accounts that have been linked for
626
+ * withdrawing stablecoins to fiat.
627
+ *
628
+ * Requires approved KYC verification.
629
+ *
630
+ * @returns List of linked bank accounts with withdrawal addresses
631
+ * @throws {Error} If KYC is not approved
632
+ *
633
+ * @example
634
+ * ```typescript
635
+ * const { banks } = await sdk.getWallet().getLinkedBanks();
636
+ * banks.forEach(bank => {
637
+ * console.log(`${bank.bankName} (****${bank.last4})`);
638
+ * });
639
+ * ```
640
+ */
641
+ getLinkedBanks(): Promise<LinkedBanksResponse>;
642
+ /**
643
+ * Link a US bank account for withdrawals (off-ramp)
644
+ *
645
+ * Links a US bank account (checking or savings) for withdrawing
646
+ * stablecoins to USD via ACH transfer.
647
+ *
648
+ * Requires approved KYC verification.
649
+ *
650
+ * @param accountOwnerName - Full name of the account owner
651
+ * @param bankName - Name of the bank (e.g., 'Chase', 'Bank of America')
652
+ * @param routingNumber - Bank routing number (9 digits)
653
+ * @param accountNumber - Bank account number
654
+ * @param checkingOrSavings - Account type: 'checking' or 'savings'
655
+ * @param address - Billing address for the account
656
+ * @returns Linked bank details with withdrawal address
657
+ * @throws {Error} If KYC is not approved or bank details are invalid
658
+ *
659
+ * @example
660
+ * ```typescript
661
+ * const result = await sdk.getWallet().linkUsBankAccount(
662
+ * 'John Doe',
663
+ * 'Chase',
664
+ * '121000248',
665
+ * '1234567890',
666
+ * 'checking',
667
+ * {
668
+ * streetLine1: '123 Main St',
669
+ * city: 'San Francisco',
670
+ * state: 'CA',
671
+ * postalCode: '94102',
672
+ * country: 'USA'
673
+ * }
674
+ * );
675
+ * console.log('Linked bank:', result.bankName);
676
+ * ```
677
+ */
678
+ linkUsBankAccount(accountOwnerName: string, bankName: string, routingNumber: string, accountNumber: string, checkingOrSavings: 'checking' | 'savings', address: BillingAddress): Promise<LinkBankResponse>;
679
+ /**
680
+ * Link a EUR/IBAN bank account for withdrawals (off-ramp)
681
+ *
682
+ * Links a European bank account via IBAN for withdrawing
683
+ * stablecoins to EUR via SEPA transfer.
684
+ *
685
+ * Requires approved KYC verification.
686
+ *
687
+ * @param accountOwnerName - Full name of the account owner
688
+ * @param accountOwnerType - Type of account owner: 'individual' or 'business'
689
+ * @param firstName - First name of the account owner
690
+ * @param lastName - Last name of the account owner
691
+ * @param ibanAccountNumber - IBAN account number
692
+ * @param bic - Optional BIC/SWIFT code
693
+ * @returns Linked bank details with withdrawal address
694
+ * @throws {Error} If KYC is not approved or bank details are invalid
695
+ *
696
+ * @example
697
+ * ```typescript
698
+ * const result = await sdk.getWallet().linkEuroAccount(
699
+ * 'Hans Mueller',
700
+ * 'individual',
701
+ * 'Hans',
702
+ * 'Mueller',
703
+ * 'DE89370400440532013000',
704
+ * 'COBADEFFXXX' // optional BIC
705
+ * );
706
+ * console.log('Linked bank:', result.bankName);
707
+ * ```
708
+ */
709
+ linkEuroAccount(accountOwnerName: string, accountOwnerType: AccountOwnerType, firstName: string, lastName: string, ibanAccountNumber: string, bic?: string): Promise<LinkBankResponse>;
710
+ /**
711
+ * Delete a linked bank account
712
+ *
713
+ * Removes a previously linked bank account from the user's off-ramp options.
714
+ *
715
+ * @param bankId - The ID of the linked bank account to delete
716
+ * @throws {Error} If the bank account doesn't exist or deletion fails
717
+ *
718
+ * @example
719
+ * ```typescript
720
+ * await sdk.getWallet().deleteLinkedBank('bank_abc123');
721
+ * console.log('Bank account deleted');
722
+ * ```
723
+ */
724
+ deleteLinkedBank(bankId: string): Promise<void>;
475
725
  }
476
726
 
477
727
  /**
@@ -767,6 +1017,33 @@ interface UserContact {
767
1017
  /** Contact name */
768
1018
  name: string;
769
1019
  }
1020
+ /**
1021
+ * KYC verification status
1022
+ */
1023
+ type KycStatus = 'not_started' | 'pending' | 'in_review' | 'approved' | 'rejected';
1024
+ /**
1025
+ * Terms of Service acceptance status
1026
+ */
1027
+ type TosStatus = 'pending' | 'approved';
1028
+ /**
1029
+ * KYC status response
1030
+ */
1031
+ interface KycStatusResponse {
1032
+ /** Current KYC status */
1033
+ status: KycStatus;
1034
+ /** Whether KYC is approved */
1035
+ isApproved: boolean;
1036
+ /** Reason for rejection (if rejected) */
1037
+ rejectionReason: string | null;
1038
+ /** KYC link ID (if KYC has been started) */
1039
+ kycLinkId: string | null;
1040
+ /** URL to complete KYC verification (if KYC has been started) */
1041
+ kycLinkUrl: string | null;
1042
+ /** Terms of Service acceptance status */
1043
+ tosStatus: TosStatus | null;
1044
+ /** URL to accept Terms of Service */
1045
+ tosLink: string | null;
1046
+ }
770
1047
  /**
771
1048
  * User contact information payload
772
1049
  */
@@ -882,6 +1159,31 @@ declare class UserAccess {
882
1159
  * ```
883
1160
  */
884
1161
  addUserContact(data: UserContactPayload): Promise<void>;
1162
+ /**
1163
+ * Get or create KYC status
1164
+ *
1165
+ * Returns the current KYC verification status. If KYC has not been started,
1166
+ * it will be initiated and the response will include a URL to complete verification.
1167
+ *
1168
+ * @param redirectUri - Optional URL to redirect user after KYC completion
1169
+ * @returns KycStatusResponse with status and verification link if applicable
1170
+ * @throws {Error} If user is not authenticated
1171
+ *
1172
+ * @example
1173
+ * ```typescript
1174
+ * const kyc = await sdk.getUser().getOrCreateKyc();
1175
+ * if (kyc.status === 'not_started' && kyc.kycLinkUrl) {
1176
+ * // Redirect user to complete KYC
1177
+ * window.open(kyc.kycLinkUrl, '_blank');
1178
+ * } else if (kyc.isApproved) {
1179
+ * console.log('KYC approved!');
1180
+ * }
1181
+ *
1182
+ * // With redirect URI
1183
+ * const kycWithRedirect = await sdk.getUser().getOrCreateKyc('https://myapp.com/callback');
1184
+ * ```
1185
+ */
1186
+ getOrCreateKyc(redirectUri?: string): Promise<KycStatusResponse>;
885
1187
  }
886
1188
 
887
1189
  /**
@@ -1598,4 +1900,4 @@ interface SDKResponse {
1598
1900
  error?: string;
1599
1901
  }
1600
1902
 
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 };
1903
+ 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 };