@wallfree-dev/stellar 0.13.42

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.
Files changed (71) hide show
  1. package/LICENSE.md +7 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +18 -0
  4. package/index.js.map +1 -0
  5. package/package.json +65 -0
  6. package/readme.md +121 -0
  7. package/v1/block-explorer/StellarBlockExplorer.d.ts +9 -0
  8. package/v1/block-explorer/StellarBlockExplorer.js +72 -0
  9. package/v1/block-explorer/StellarBlockExplorer.js.map +1 -0
  10. package/v1/data/StellarAddress.d.ts +8 -0
  11. package/v1/data/StellarAddress.js +27 -0
  12. package/v1/data/StellarAddress.js.map +1 -0
  13. package/v1/index.d.ts +14 -0
  14. package/v1/index.js +13 -0
  15. package/v1/index.js.map +1 -0
  16. package/v1/module/StellarAssets.d.ts +3 -0
  17. package/v1/module/StellarAssets.js +47 -0
  18. package/v1/module/StellarAssets.js.map +1 -0
  19. package/v1/module/StellarModule.d.ts +14 -0
  20. package/v1/module/StellarModule.js +124 -0
  21. package/v1/module/StellarModule.js.map +1 -0
  22. package/v1/module.d.ts +3 -0
  23. package/v1/module.js +24 -0
  24. package/v1/module.js.map +1 -0
  25. package/v1/protocol/StellarProtocol.d.ts +65 -0
  26. package/v1/protocol/StellarProtocol.js +956 -0
  27. package/v1/protocol/StellarProtocol.js.map +1 -0
  28. package/v1/protocol/stellarAssets/StellarAsset.d.ts +18 -0
  29. package/v1/protocol/stellarAssets/StellarAsset.js +498 -0
  30. package/v1/protocol/stellarAssets/StellarAsset.js.map +1 -0
  31. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +7 -0
  32. package/v1/serializer/v3/schemas/converter/transaction-converter.js +42 -0
  33. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
  34. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.d.ts +4 -0
  35. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.js +3 -0
  36. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.js.map +1 -0
  37. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.d.ts +3 -0
  38. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.js +3 -0
  39. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.js.map +1 -0
  40. package/v1/serializer/v3/schemas/generated/transaction-sign-request-stellar.json +29 -0
  41. package/v1/serializer/v3/schemas/generated/transaction-sign-response-stellar.json +19 -0
  42. package/v1/serializer/v3/serializer-companion.d.ts +14 -0
  43. package/v1/serializer/v3/serializer-companion.js +168 -0
  44. package/v1/serializer/v3/serializer-companion.js.map +1 -0
  45. package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
  46. package/v1/serializer/v3/validators/transaction-validator.js +89 -0
  47. package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
  48. package/v1/serializer/v3/validators/validators.d.ts +6 -0
  49. package/v1/serializer/v3/validators/validators.js +91 -0
  50. package/v1/serializer/v3/validators/validators.js.map +1 -0
  51. package/v1/types/crypto.d.ts +2 -0
  52. package/v1/types/crypto.js +3 -0
  53. package/v1/types/crypto.js.map +1 -0
  54. package/v1/types/protocol.d.ts +42 -0
  55. package/v1/types/protocol.js +22 -0
  56. package/v1/types/protocol.js.map +1 -0
  57. package/v1/types/transaction.d.ts +10 -0
  58. package/v1/types/transaction.js +6 -0
  59. package/v1/types/transaction.js.map +1 -0
  60. package/v1/utils/convert.d.ts +3 -0
  61. package/v1/utils/convert.js +32 -0
  62. package/v1/utils/convert.js.map +1 -0
  63. package/v1/utils/key.d.ts +3 -0
  64. package/v1/utils/key.js +37 -0
  65. package/v1/utils/key.js.map +1 -0
  66. package/v1/utils/signature.d.ts +2 -0
  67. package/v1/utils/signature.js +22 -0
  68. package/v1/utils/signature.js.map +1 -0
  69. package/v1/utils/transaction.d.ts +3 -0
  70. package/v1/utils/transaction.js +22 -0
  71. package/v1/utils/transaction.js.map +1 -0
@@ -0,0 +1,65 @@
1
+ import { Address, AirGapProtocol, AirGapTransaction, Balance, CryptoDerivative, FeeDefaults, KeyPair, ProtocolMetadata, PublicKey, RecursivePartial, SecretKey, TransactionFullConfiguration, TransactionDetails, AirGapTransactionsWithCursor, Amount, TransactionSimpleConfiguration, WalletConnectRequest } from '@wallfree-dev/module-kit';
2
+ import { Transaction, Horizon } from '@stellar/stellar-sdk';
3
+ import { StellarCryptoConfiguration } from '../types/crypto';
4
+ import { StellarProtocolNetwork, StellarProtocolOptions, StellarSigner, StellarThresholds, StellarUnits } from '../types/protocol';
5
+ import { StellarSignedTransaction, StellarTransactionCursor, StellarUnsignedTransaction } from '../types/transaction';
6
+ export interface StellarProtocol extends AirGapProtocol<{
7
+ AddressResult: Address;
8
+ ProtocolNetwork: StellarProtocolNetwork;
9
+ CryptoConfiguration: StellarCryptoConfiguration;
10
+ SignedTransaction: StellarSignedTransaction;
11
+ TransactionCursor: StellarTransactionCursor;
12
+ Units: StellarUnits;
13
+ FeeEstimation: FeeDefaults<StellarUnits>;
14
+ UnsignedTransaction: StellarUnsignedTransaction;
15
+ }, 'FetchDataForAddress', 'WalletConnect', 'Multisig'> {
16
+ server: Horizon.Server;
17
+ options: StellarProtocolOptions;
18
+ getDetailsFromEncodedGenericTransaction(transaction: string): Promise<Transaction>;
19
+ getSigners(publicKey: PublicKey): Promise<StellarSigner[]>;
20
+ adjustSigner(masterPublicky: PublicKey, signerPublicKey: PublicKey, weight: number, lowThreshold: number, medThreshold: number, highThreshold: number): Promise<StellarUnsignedTransaction>;
21
+ getThresholds(publicKey: PublicKey): Promise<StellarThresholds>;
22
+ getThresholdReachedStatus(transaction: string): Promise<{
23
+ thresholdRequired: number;
24
+ currentThreshold: number;
25
+ }>;
26
+ }
27
+ export declare class StellarProtocolImpl implements StellarProtocol {
28
+ readonly options: StellarProtocolOptions;
29
+ readonly server: Horizon.Server;
30
+ constructor(options?: RecursivePartial<StellarProtocolOptions>);
31
+ getMultisigStatus(publicKey: PublicKey): Promise<boolean>;
32
+ getSigners(publicKey: PublicKey): Promise<StellarSigner[]>;
33
+ getThresholds(publicKey: PublicKey): Promise<StellarThresholds>;
34
+ getThresholdReachedStatus(transaction: string): Promise<{
35
+ thresholdRequired: number;
36
+ currentThreshold: number;
37
+ }>;
38
+ adjustSigner(masterPublicky: PublicKey, signerPublicKey: PublicKey, weight: number, lowThreshold: number, medThreshold: number, highThreshold: number): Promise<StellarUnsignedTransaction>;
39
+ getTransactionsForPublicKey(publicKey: PublicKey, limit: number, cursor?: StellarTransactionCursor | undefined): Promise<AirGapTransactionsWithCursor<StellarTransactionCursor, StellarUnits>>;
40
+ getTransactionsForAddress(address: Address, limit: number, cursor?: StellarTransactionCursor | undefined): Promise<AirGapTransactionsWithCursor<StellarTransactionCursor, StellarUnits>>;
41
+ getTransactionMaxAmountWithPublicKey(publicKey: PublicKey, to: Address[], configuration?: TransactionFullConfiguration<StellarUnits>): Promise<Amount<StellarUnits>>;
42
+ getTransactionFeeWithPublicKey(publicKey: PublicKey, details: TransactionDetails<StellarUnits>[], configuration?: TransactionSimpleConfiguration): Promise<FeeDefaults<StellarUnits>>;
43
+ private readonly units;
44
+ private readonly feeDefaults;
45
+ private readonly metadata;
46
+ getMetadata(): Promise<ProtocolMetadata<StellarUnits>>;
47
+ getAddressFromPublicKey(publicKey: PublicKey): Promise<string>;
48
+ getDetailsFromTransaction(transaction: StellarSignedTransaction | StellarUnsignedTransaction, _publicKey: PublicKey): Promise<AirGapTransaction<StellarUnits>[]>;
49
+ getDetailsFromEncodedGenericTransaction(transaction: string): Promise<Transaction>;
50
+ private getDetailsFromEncodedTransaction;
51
+ private readonly cryptoConfiguration;
52
+ getCryptoConfiguration(): Promise<StellarCryptoConfiguration>;
53
+ getKeyPairFromDerivative(derivative: CryptoDerivative): Promise<KeyPair>;
54
+ signTransactionWithSecretKey(transaction: StellarUnsignedTransaction, secretKey: SecretKey): Promise<StellarSignedTransaction>;
55
+ getNetwork(): Promise<StellarProtocolNetwork>;
56
+ getBalanceOfPublicKey(publicKey: PublicKey): Promise<Balance<StellarUnits>>;
57
+ getBalanceOfAddress(address: string): Promise<Balance<StellarUnits>>;
58
+ prepareTransactionWithPublicKey(publicKey: PublicKey, details: TransactionDetails<StellarUnits>[], configuration?: TransactionFullConfiguration<StellarUnits>): Promise<StellarUnsignedTransaction>;
59
+ broadcastTransaction(transaction: StellarSignedTransaction): Promise<string>;
60
+ getWalletConnectChain(): Promise<string>;
61
+ prepareWalletConnectTransactionWithPublicKey(publicKey: PublicKey, request: WalletConnectRequest): Promise<StellarUnsignedTransaction>;
62
+ }
63
+ export declare function createStellarProtocol(options?: RecursivePartial<StellarProtocolOptions>): StellarProtocol;
64
+ export declare const STELLAR_MAINNET_PROTOCOL_NETWORK: StellarProtocolNetwork;
65
+ export declare function createStellarProtocolOptions(network?: Partial<StellarProtocolNetwork>): StellarProtocolOptions;