@frontiertower/frontier-sdk 0.11.1 → 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/dist/index.js CHANGED
@@ -49,8 +49,8 @@ var WalletAccess = class {
49
49
  /**
50
50
  * Get the current wallet balance breakdown
51
51
  *
52
- * Returns the balance breakdown including total, native FTD,
53
- * and internal FTD amounts.
52
+ * Returns the balance breakdown including total, native FND,
53
+ * and internal FND amounts.
54
54
  *
55
55
  * @returns Balance breakdown object
56
56
  * @throws {Error} If no wallet exists
@@ -59,7 +59,7 @@ var WalletAccess = class {
59
59
  * ```typescript
60
60
  * const balance = await sdk.getWallet().getBalance();
61
61
  * console.log('Total Balance:', balance.total.toString());
62
- * console.log('FTD Balance:', balance.ftd.toString());
62
+ * console.log('FND Balance:', balance.fnd.toString());
63
63
  * ```
64
64
  */
65
65
  async getBalance() {
@@ -229,7 +229,7 @@ var WalletAccess = class {
229
229
  * import { encodeFunctionData } from 'viem';
230
230
  *
231
231
  * const receipt = await sdk.getWallet().executeCall({
232
- * to: '0xContractAddress',
232
+ * target: '0xContractAddress',
233
233
  * value: 0n,
234
234
  * data: encodeFunctionData({
235
235
  * abi: contractABI,
@@ -301,7 +301,7 @@ var WalletAccess = class {
301
301
  });
302
302
  }
303
303
  /**
304
- * Transfer Frontier Dollars with Internal Frontier Dollars (iFTD) preferred
304
+ * Transfer Frontier Dollars with Internal Frontier Network Dollars (iFND) preferred
305
305
  *
306
306
  * This method will use Internal Frontier Dollars first, and if insufficient,
307
307
  * it will use regular Frontier Dollars to complete the transfer.
@@ -344,12 +344,12 @@ var WalletAccess = class {
344
344
  *
345
345
  * const receipt = await sdk.getWallet().executeBatchCall([
346
346
  * {
347
- * to: '0xToken1',
347
+ * target: '0xToken1',
348
348
  * value: 0n,
349
349
  * data: encodeFunctionData({ abi: erc20Abi, functionName: 'approve', args: [...] })
350
350
  * },
351
351
  * {
352
- * to: '0xProtocol',
352
+ * target: '0xProtocol',
353
353
  * value: 0n,
354
354
  * data: encodeFunctionData({ abi: protocolAbi, functionName: 'deposit', args: [...] })
355
355
  * }
@@ -368,12 +368,12 @@ var WalletAccess = class {
368
368
  * Returns an array of token symbols that are supported for swaps
369
369
  * and other operations on the current network.
370
370
  *
371
- * @returns Array of token symbols (e.g., ['FTD', 'USDC', 'WETH'])
371
+ * @returns Array of token symbols (e.g., ['FND', 'USDC', 'WETH'])
372
372
  *
373
373
  * @example
374
374
  * ```typescript
375
375
  * const tokens = await sdk.getWallet().getSupportedTokens();
376
- * console.log('Supported tokens:', tokens); // ['FTD', 'USDC', 'WETH']
376
+ * console.log('Supported tokens:', tokens); // ['FND', 'USDC', 'WETH']
377
377
  * ```
378
378
  */
379
379
  async getSupportedTokens() {
@@ -447,6 +447,179 @@ var WalletAccess = class {
447
447
  amount
448
448
  });
449
449
  }
450
+ /**
451
+ * Get USD deposit instructions for fiat on-ramp
452
+ *
453
+ * Returns US bank details where user should send their USD deposit.
454
+ * The deposited fiat will be converted to stablecoins and sent to
455
+ * the user's wallet address.
456
+ *
457
+ * Requires approved KYC verification.
458
+ *
459
+ * @returns Bank details including routing number, account number, and beneficiary info
460
+ * @throws {Error} If KYC is not approved
461
+ *
462
+ * @example
463
+ * ```typescript
464
+ * const instructions = await sdk.getWallet().getUsdDepositInstructions();
465
+ * console.log('Bank:', instructions.depositInstructions.bankName);
466
+ * console.log('Routing:', instructions.depositInstructions.bankRoutingNumber);
467
+ * console.log('Account:', instructions.depositInstructions.bankAccountNumber);
468
+ * console.log('Beneficiary:', instructions.depositInstructions.bankBeneficiaryName);
469
+ * ```
470
+ */
471
+ async getUsdDepositInstructions() {
472
+ return this.sdk.request("wallet:getUsdDepositInstructions");
473
+ }
474
+ /**
475
+ * Get EUR deposit instructions for fiat on-ramp (SEPA)
476
+ *
477
+ * Returns SEPA bank details where user should send their EUR deposit.
478
+ * The deposited fiat will be converted to stablecoins and sent to
479
+ * the user's wallet address.
480
+ *
481
+ * Requires approved KYC verification.
482
+ *
483
+ * @returns SEPA bank details including IBAN, BIC, and beneficiary info
484
+ * @throws {Error} If KYC is not approved
485
+ *
486
+ * @example
487
+ * ```typescript
488
+ * const instructions = await sdk.getWallet().getEurDepositInstructions();
489
+ * console.log('IBAN:', instructions.depositInstructions.iban);
490
+ * console.log('BIC:', instructions.depositInstructions.bic);
491
+ * console.log('Bank:', instructions.depositInstructions.bankName);
492
+ * console.log('Beneficiary:', instructions.depositInstructions.beneficiaryName);
493
+ * ```
494
+ */
495
+ async getEurDepositInstructions() {
496
+ return this.sdk.request("wallet:getEurDepositInstructions");
497
+ }
498
+ /**
499
+ * Get all linked bank accounts for withdrawals (off-ramp)
500
+ *
501
+ * Returns a list of bank accounts that have been linked for
502
+ * withdrawing stablecoins to fiat.
503
+ *
504
+ * Requires approved KYC verification.
505
+ *
506
+ * @returns List of linked bank accounts with withdrawal addresses
507
+ * @throws {Error} If KYC is not approved
508
+ *
509
+ * @example
510
+ * ```typescript
511
+ * const { banks } = await sdk.getWallet().getLinkedBanks();
512
+ * banks.forEach(bank => {
513
+ * console.log(`${bank.bankName} (****${bank.last4})`);
514
+ * });
515
+ * ```
516
+ */
517
+ async getLinkedBanks() {
518
+ return this.sdk.request("wallet:getLinkedBanks");
519
+ }
520
+ /**
521
+ * Link a US bank account for withdrawals (off-ramp)
522
+ *
523
+ * Links a US bank account (checking or savings) for withdrawing
524
+ * stablecoins to USD via ACH transfer.
525
+ *
526
+ * Requires approved KYC verification.
527
+ *
528
+ * @param accountOwnerName - Full name of the account owner
529
+ * @param bankName - Name of the bank (e.g., 'Chase', 'Bank of America')
530
+ * @param routingNumber - Bank routing number (9 digits)
531
+ * @param accountNumber - Bank account number
532
+ * @param checkingOrSavings - Account type: 'checking' or 'savings'
533
+ * @param address - Billing address for the account
534
+ * @returns Linked bank details with withdrawal address
535
+ * @throws {Error} If KYC is not approved or bank details are invalid
536
+ *
537
+ * @example
538
+ * ```typescript
539
+ * const result = await sdk.getWallet().linkUsBankAccount(
540
+ * 'John Doe',
541
+ * 'Chase',
542
+ * '121000248',
543
+ * '1234567890',
544
+ * 'checking',
545
+ * {
546
+ * streetLine1: '123 Main St',
547
+ * city: 'San Francisco',
548
+ * state: 'CA',
549
+ * postalCode: '94102',
550
+ * country: 'USA'
551
+ * }
552
+ * );
553
+ * console.log('Linked bank:', result.bankName);
554
+ * ```
555
+ */
556
+ async linkUsBankAccount(accountOwnerName, bankName, routingNumber, accountNumber, checkingOrSavings, address) {
557
+ return this.sdk.request("wallet:linkUsBankAccount", {
558
+ accountOwnerName,
559
+ bankName,
560
+ routingNumber,
561
+ accountNumber,
562
+ checkingOrSavings,
563
+ address
564
+ });
565
+ }
566
+ /**
567
+ * Link a EUR/IBAN bank account for withdrawals (off-ramp)
568
+ *
569
+ * Links a European bank account via IBAN for withdrawing
570
+ * stablecoins to EUR via SEPA transfer.
571
+ *
572
+ * Requires approved KYC verification.
573
+ *
574
+ * @param accountOwnerName - Full name of the account owner
575
+ * @param accountOwnerType - Type of account owner: 'individual' or 'business'
576
+ * @param firstName - First name of the account owner
577
+ * @param lastName - Last name of the account owner
578
+ * @param ibanAccountNumber - IBAN account number
579
+ * @param bic - Optional BIC/SWIFT code
580
+ * @returns Linked bank details with withdrawal address
581
+ * @throws {Error} If KYC is not approved or bank details are invalid
582
+ *
583
+ * @example
584
+ * ```typescript
585
+ * const result = await sdk.getWallet().linkEuroAccount(
586
+ * 'Hans Mueller',
587
+ * 'individual',
588
+ * 'Hans',
589
+ * 'Mueller',
590
+ * 'DE89370400440532013000',
591
+ * 'COBADEFFXXX' // optional BIC
592
+ * );
593
+ * console.log('Linked bank:', result.bankName);
594
+ * ```
595
+ */
596
+ async linkEuroAccount(accountOwnerName, accountOwnerType, firstName, lastName, ibanAccountNumber, bic) {
597
+ return this.sdk.request("wallet:linkEuroAccount", {
598
+ accountOwnerName,
599
+ accountOwnerType,
600
+ firstName,
601
+ lastName,
602
+ ibanAccountNumber,
603
+ bic
604
+ });
605
+ }
606
+ /**
607
+ * Delete a linked bank account
608
+ *
609
+ * Removes a previously linked bank account from the user's off-ramp options.
610
+ *
611
+ * @param bankId - The ID of the linked bank account to delete
612
+ * @throws {Error} If the bank account doesn't exist or deletion fails
613
+ *
614
+ * @example
615
+ * ```typescript
616
+ * await sdk.getWallet().deleteLinkedBank('bank_abc123');
617
+ * console.log('Bank account deleted');
618
+ * ```
619
+ */
620
+ async deleteLinkedBank(bankId) {
621
+ return this.sdk.request("wallet:deleteLinkedBank", { bankId });
622
+ }
450
623
  };
451
624
 
452
625
  // src/access/storage.ts
@@ -673,6 +846,33 @@ var UserAccess = class {
673
846
  async addUserContact(data) {
674
847
  return this.sdk.request("user:addUserContact", data);
675
848
  }
849
+ /**
850
+ * Get or create KYC status
851
+ *
852
+ * Returns the current KYC verification status. If KYC has not been started,
853
+ * it will be initiated and the response will include a URL to complete verification.
854
+ *
855
+ * @param redirectUri - Optional URL to redirect user after KYC completion
856
+ * @returns KycStatusResponse with status and verification link if applicable
857
+ * @throws {Error} If user is not authenticated
858
+ *
859
+ * @example
860
+ * ```typescript
861
+ * const kyc = await sdk.getUser().getOrCreateKyc();
862
+ * if (kyc.status === 'not_started' && kyc.kycLinkUrl) {
863
+ * // Redirect user to complete KYC
864
+ * window.open(kyc.kycLinkUrl, '_blank');
865
+ * } else if (kyc.isApproved) {
866
+ * console.log('KYC approved!');
867
+ * }
868
+ *
869
+ * // With redirect URI
870
+ * const kycWithRedirect = await sdk.getUser().getOrCreateKyc('https://myapp.com/callback');
871
+ * ```
872
+ */
873
+ async getOrCreateKyc(redirectUri) {
874
+ return this.sdk.request("user:getOrCreateKyc", redirectUri);
875
+ }
676
876
  };
677
877
 
678
878
  // src/access/partnerships.ts
package/dist/index.mjs CHANGED
@@ -18,8 +18,8 @@ var WalletAccess = class {
18
18
  /**
19
19
  * Get the current wallet balance breakdown
20
20
  *
21
- * Returns the balance breakdown including total, native FTD,
22
- * and internal FTD amounts.
21
+ * Returns the balance breakdown including total, native FND,
22
+ * and internal FND amounts.
23
23
  *
24
24
  * @returns Balance breakdown object
25
25
  * @throws {Error} If no wallet exists
@@ -28,7 +28,7 @@ var WalletAccess = class {
28
28
  * ```typescript
29
29
  * const balance = await sdk.getWallet().getBalance();
30
30
  * console.log('Total Balance:', balance.total.toString());
31
- * console.log('FTD Balance:', balance.ftd.toString());
31
+ * console.log('FND Balance:', balance.fnd.toString());
32
32
  * ```
33
33
  */
34
34
  async getBalance() {
@@ -198,7 +198,7 @@ var WalletAccess = class {
198
198
  * import { encodeFunctionData } from 'viem';
199
199
  *
200
200
  * const receipt = await sdk.getWallet().executeCall({
201
- * to: '0xContractAddress',
201
+ * target: '0xContractAddress',
202
202
  * value: 0n,
203
203
  * data: encodeFunctionData({
204
204
  * abi: contractABI,
@@ -270,7 +270,7 @@ var WalletAccess = class {
270
270
  });
271
271
  }
272
272
  /**
273
- * Transfer Frontier Dollars with Internal Frontier Dollars (iFTD) preferred
273
+ * Transfer Frontier Dollars with Internal Frontier Network Dollars (iFND) preferred
274
274
  *
275
275
  * This method will use Internal Frontier Dollars first, and if insufficient,
276
276
  * it will use regular Frontier Dollars to complete the transfer.
@@ -313,12 +313,12 @@ var WalletAccess = class {
313
313
  *
314
314
  * const receipt = await sdk.getWallet().executeBatchCall([
315
315
  * {
316
- * to: '0xToken1',
316
+ * target: '0xToken1',
317
317
  * value: 0n,
318
318
  * data: encodeFunctionData({ abi: erc20Abi, functionName: 'approve', args: [...] })
319
319
  * },
320
320
  * {
321
- * to: '0xProtocol',
321
+ * target: '0xProtocol',
322
322
  * value: 0n,
323
323
  * data: encodeFunctionData({ abi: protocolAbi, functionName: 'deposit', args: [...] })
324
324
  * }
@@ -337,12 +337,12 @@ var WalletAccess = class {
337
337
  * Returns an array of token symbols that are supported for swaps
338
338
  * and other operations on the current network.
339
339
  *
340
- * @returns Array of token symbols (e.g., ['FTD', 'USDC', 'WETH'])
340
+ * @returns Array of token symbols (e.g., ['FND', 'USDC', 'WETH'])
341
341
  *
342
342
  * @example
343
343
  * ```typescript
344
344
  * const tokens = await sdk.getWallet().getSupportedTokens();
345
- * console.log('Supported tokens:', tokens); // ['FTD', 'USDC', 'WETH']
345
+ * console.log('Supported tokens:', tokens); // ['FND', 'USDC', 'WETH']
346
346
  * ```
347
347
  */
348
348
  async getSupportedTokens() {
@@ -416,6 +416,179 @@ var WalletAccess = class {
416
416
  amount
417
417
  });
418
418
  }
419
+ /**
420
+ * Get USD deposit instructions for fiat on-ramp
421
+ *
422
+ * Returns US bank details where user should send their USD deposit.
423
+ * The deposited fiat will be converted to stablecoins and sent to
424
+ * the user's wallet address.
425
+ *
426
+ * Requires approved KYC verification.
427
+ *
428
+ * @returns Bank details including routing number, account number, and beneficiary info
429
+ * @throws {Error} If KYC is not approved
430
+ *
431
+ * @example
432
+ * ```typescript
433
+ * const instructions = await sdk.getWallet().getUsdDepositInstructions();
434
+ * console.log('Bank:', instructions.depositInstructions.bankName);
435
+ * console.log('Routing:', instructions.depositInstructions.bankRoutingNumber);
436
+ * console.log('Account:', instructions.depositInstructions.bankAccountNumber);
437
+ * console.log('Beneficiary:', instructions.depositInstructions.bankBeneficiaryName);
438
+ * ```
439
+ */
440
+ async getUsdDepositInstructions() {
441
+ return this.sdk.request("wallet:getUsdDepositInstructions");
442
+ }
443
+ /**
444
+ * Get EUR deposit instructions for fiat on-ramp (SEPA)
445
+ *
446
+ * Returns SEPA bank details where user should send their EUR deposit.
447
+ * The deposited fiat will be converted to stablecoins and sent to
448
+ * the user's wallet address.
449
+ *
450
+ * Requires approved KYC verification.
451
+ *
452
+ * @returns SEPA bank details including IBAN, BIC, and beneficiary info
453
+ * @throws {Error} If KYC is not approved
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * const instructions = await sdk.getWallet().getEurDepositInstructions();
458
+ * console.log('IBAN:', instructions.depositInstructions.iban);
459
+ * console.log('BIC:', instructions.depositInstructions.bic);
460
+ * console.log('Bank:', instructions.depositInstructions.bankName);
461
+ * console.log('Beneficiary:', instructions.depositInstructions.beneficiaryName);
462
+ * ```
463
+ */
464
+ async getEurDepositInstructions() {
465
+ return this.sdk.request("wallet:getEurDepositInstructions");
466
+ }
467
+ /**
468
+ * Get all linked bank accounts for withdrawals (off-ramp)
469
+ *
470
+ * Returns a list of bank accounts that have been linked for
471
+ * withdrawing stablecoins to fiat.
472
+ *
473
+ * Requires approved KYC verification.
474
+ *
475
+ * @returns List of linked bank accounts with withdrawal addresses
476
+ * @throws {Error} If KYC is not approved
477
+ *
478
+ * @example
479
+ * ```typescript
480
+ * const { banks } = await sdk.getWallet().getLinkedBanks();
481
+ * banks.forEach(bank => {
482
+ * console.log(`${bank.bankName} (****${bank.last4})`);
483
+ * });
484
+ * ```
485
+ */
486
+ async getLinkedBanks() {
487
+ return this.sdk.request("wallet:getLinkedBanks");
488
+ }
489
+ /**
490
+ * Link a US bank account for withdrawals (off-ramp)
491
+ *
492
+ * Links a US bank account (checking or savings) for withdrawing
493
+ * stablecoins to USD via ACH transfer.
494
+ *
495
+ * Requires approved KYC verification.
496
+ *
497
+ * @param accountOwnerName - Full name of the account owner
498
+ * @param bankName - Name of the bank (e.g., 'Chase', 'Bank of America')
499
+ * @param routingNumber - Bank routing number (9 digits)
500
+ * @param accountNumber - Bank account number
501
+ * @param checkingOrSavings - Account type: 'checking' or 'savings'
502
+ * @param address - Billing address for the account
503
+ * @returns Linked bank details with withdrawal address
504
+ * @throws {Error} If KYC is not approved or bank details are invalid
505
+ *
506
+ * @example
507
+ * ```typescript
508
+ * const result = await sdk.getWallet().linkUsBankAccount(
509
+ * 'John Doe',
510
+ * 'Chase',
511
+ * '121000248',
512
+ * '1234567890',
513
+ * 'checking',
514
+ * {
515
+ * streetLine1: '123 Main St',
516
+ * city: 'San Francisco',
517
+ * state: 'CA',
518
+ * postalCode: '94102',
519
+ * country: 'USA'
520
+ * }
521
+ * );
522
+ * console.log('Linked bank:', result.bankName);
523
+ * ```
524
+ */
525
+ async linkUsBankAccount(accountOwnerName, bankName, routingNumber, accountNumber, checkingOrSavings, address) {
526
+ return this.sdk.request("wallet:linkUsBankAccount", {
527
+ accountOwnerName,
528
+ bankName,
529
+ routingNumber,
530
+ accountNumber,
531
+ checkingOrSavings,
532
+ address
533
+ });
534
+ }
535
+ /**
536
+ * Link a EUR/IBAN bank account for withdrawals (off-ramp)
537
+ *
538
+ * Links a European bank account via IBAN for withdrawing
539
+ * stablecoins to EUR via SEPA transfer.
540
+ *
541
+ * Requires approved KYC verification.
542
+ *
543
+ * @param accountOwnerName - Full name of the account owner
544
+ * @param accountOwnerType - Type of account owner: 'individual' or 'business'
545
+ * @param firstName - First name of the account owner
546
+ * @param lastName - Last name of the account owner
547
+ * @param ibanAccountNumber - IBAN account number
548
+ * @param bic - Optional BIC/SWIFT code
549
+ * @returns Linked bank details with withdrawal address
550
+ * @throws {Error} If KYC is not approved or bank details are invalid
551
+ *
552
+ * @example
553
+ * ```typescript
554
+ * const result = await sdk.getWallet().linkEuroAccount(
555
+ * 'Hans Mueller',
556
+ * 'individual',
557
+ * 'Hans',
558
+ * 'Mueller',
559
+ * 'DE89370400440532013000',
560
+ * 'COBADEFFXXX' // optional BIC
561
+ * );
562
+ * console.log('Linked bank:', result.bankName);
563
+ * ```
564
+ */
565
+ async linkEuroAccount(accountOwnerName, accountOwnerType, firstName, lastName, ibanAccountNumber, bic) {
566
+ return this.sdk.request("wallet:linkEuroAccount", {
567
+ accountOwnerName,
568
+ accountOwnerType,
569
+ firstName,
570
+ lastName,
571
+ ibanAccountNumber,
572
+ bic
573
+ });
574
+ }
575
+ /**
576
+ * Delete a linked bank account
577
+ *
578
+ * Removes a previously linked bank account from the user's off-ramp options.
579
+ *
580
+ * @param bankId - The ID of the linked bank account to delete
581
+ * @throws {Error} If the bank account doesn't exist or deletion fails
582
+ *
583
+ * @example
584
+ * ```typescript
585
+ * await sdk.getWallet().deleteLinkedBank('bank_abc123');
586
+ * console.log('Bank account deleted');
587
+ * ```
588
+ */
589
+ async deleteLinkedBank(bankId) {
590
+ return this.sdk.request("wallet:deleteLinkedBank", { bankId });
591
+ }
419
592
  };
420
593
 
421
594
  // src/access/storage.ts
@@ -642,6 +815,33 @@ var UserAccess = class {
642
815
  async addUserContact(data) {
643
816
  return this.sdk.request("user:addUserContact", data);
644
817
  }
818
+ /**
819
+ * Get or create KYC status
820
+ *
821
+ * Returns the current KYC verification status. If KYC has not been started,
822
+ * it will be initiated and the response will include a URL to complete verification.
823
+ *
824
+ * @param redirectUri - Optional URL to redirect user after KYC completion
825
+ * @returns KycStatusResponse with status and verification link if applicable
826
+ * @throws {Error} If user is not authenticated
827
+ *
828
+ * @example
829
+ * ```typescript
830
+ * const kyc = await sdk.getUser().getOrCreateKyc();
831
+ * if (kyc.status === 'not_started' && kyc.kycLinkUrl) {
832
+ * // Redirect user to complete KYC
833
+ * window.open(kyc.kycLinkUrl, '_blank');
834
+ * } else if (kyc.isApproved) {
835
+ * console.log('KYC approved!');
836
+ * }
837
+ *
838
+ * // With redirect URI
839
+ * const kycWithRedirect = await sdk.getUser().getOrCreateKyc('https://myapp.com/callback');
840
+ * ```
841
+ */
842
+ async getOrCreateKyc(redirectUri) {
843
+ return this.sdk.request("user:getOrCreateKyc", redirectUri);
844
+ }
645
845
  };
646
846
 
647
847
  // src/access/partnerships.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontiertower/frontier-sdk",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "SDK for building apps on Frontier Wallet",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -47,5 +47,8 @@
47
47
  "type": "git",
48
48
  "url": "git+https://github.com/BerlinhouseLabs/frontier-sdk.git"
49
49
  },
50
- "readme": "README.md"
50
+ "readme": "README.md",
51
+ "dependencies": {
52
+ "qrcode.react": "^4.2.0"
53
+ }
51
54
  }