@trezor/connect 9.0.0-beta.4 → 9.0.0-beta.7

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 (157) hide show
  1. package/README.md +37 -14
  2. package/lib/api/binance/binanceSignTx.d.ts +1 -1
  3. package/lib/api/binanceSignTransaction.d.ts +1 -1
  4. package/lib/api/binanceSignTransaction.js +1 -1
  5. package/lib/api/bitcoin/Fees.js +1 -1
  6. package/lib/api/bitcoin/TransactionComposer.js +1 -1
  7. package/lib/api/bitcoin/enhanceSignTx.d.ts +1 -1
  8. package/lib/api/bitcoin/index.js +9 -9
  9. package/lib/api/bitcoin/refTx.d.ts +3 -3
  10. package/lib/api/bitcoin/signtx.d.ts +1 -1
  11. package/lib/api/bitcoin/signtxLegacy.d.ts +1 -1
  12. package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
  13. package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
  14. package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
  15. package/lib/api/cardano/cardanoInputs.d.ts +1 -0
  16. package/lib/api/cardano/cardanoInputs.js +12 -1
  17. package/lib/api/cardano/cardanoOutputs.d.ts +6 -3
  18. package/lib/api/cardano/cardanoOutputs.js +37 -1
  19. package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
  20. package/lib/api/cardano/cardanoUtils.d.ts +3 -0
  21. package/lib/api/cardano/cardanoUtils.js +17 -0
  22. package/lib/api/cardano/cardanoWitnesses.js +4 -4
  23. package/lib/api/cardanoGetAddress.d.ts +1 -1
  24. package/lib/api/cardanoGetNativeScriptHash.d.ts +1 -1
  25. package/lib/api/cardanoGetPublicKey.d.ts +1 -1
  26. package/lib/api/cardanoSignTransaction.d.ts +8 -4
  27. package/lib/api/cardanoSignTransaction.js +40 -17
  28. package/lib/api/common/Discovery.js +1 -1
  29. package/lib/api/common/paramsValidator.d.ts +1 -1
  30. package/lib/api/composeTransaction.d.ts +1 -1
  31. package/lib/api/composeTransaction.js +2 -2
  32. package/lib/api/eos/eosSignTx.d.ts +1 -1
  33. package/lib/api/eos/eosSignTx.js +1 -1
  34. package/lib/api/eosGetPublicKey.d.ts +1 -1
  35. package/lib/api/eosSignTransaction.js +1 -1
  36. package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.js +1 -1
  37. package/lib/api/ethereum/ethereumSignTx.d.ts +3 -3
  38. package/lib/api/ethereum/ethereumSignTypedData.d.ts +1 -1
  39. package/lib/api/ethereum/ethereumSignTypedData.js +1 -1
  40. package/lib/api/ethereumSignTransaction.d.ts +1 -1
  41. package/lib/api/ethereumSignTransaction.js +1 -1
  42. package/lib/api/ethereumSignTypedData.d.ts +1 -1
  43. package/lib/api/firmware/calculateFirmwareHash.d.ts +6 -0
  44. package/lib/api/firmware/calculateFirmwareHash.js +26 -0
  45. package/lib/api/firmware/getBinary.d.ts +2 -2
  46. package/lib/api/firmware/getBinary.js +2 -3
  47. package/lib/api/firmware/index.d.ts +5 -0
  48. package/lib/api/firmware/index.js +13 -0
  49. package/lib/api/firmware/modifyFirmware.d.ts +3 -5
  50. package/lib/api/firmware/modifyFirmware.js +12 -10
  51. package/lib/api/{management → firmware}/uploadFirmware.d.ts +0 -0
  52. package/lib/api/{management → firmware}/uploadFirmware.js +0 -0
  53. package/lib/api/firmwareUpdate.d.ts +4 -1
  54. package/lib/api/firmwareUpdate.js +8 -13
  55. package/lib/api/getFirmwareHash.d.ts +7 -0
  56. package/lib/api/getFirmwareHash.js +29 -0
  57. package/lib/api/index.d.ts +1 -0
  58. package/lib/api/index.js +4 -2
  59. package/lib/api/nem/nemSignTx.d.ts +1 -1
  60. package/lib/api/nemSignTransaction.js +1 -1
  61. package/lib/api/signTransaction.d.ts +2 -2
  62. package/lib/api/signTransaction.js +1 -1
  63. package/lib/api/stellar/stellarSignTx.d.ts +1 -1
  64. package/lib/api/stellarSignTransaction.d.ts +1 -1
  65. package/lib/api/stellarSignTransaction.js +1 -1
  66. package/lib/api/tezos/tezosSignTx.d.ts +1 -1
  67. package/lib/api/tezos/tezosSignTx.js +1 -1
  68. package/lib/api/tezosSignTransaction.js +1 -1
  69. package/lib/backend/BlockchainLink.js +1 -1
  70. package/lib/constants/errors.d.ts +1 -1
  71. package/lib/constants/errors.js +1 -1
  72. package/lib/constants/index.js +5 -5
  73. package/lib/core/AbstractMethod.js +1 -1
  74. package/lib/core/index.d.ts +1 -1
  75. package/lib/core/index.js +1 -1
  76. package/lib/core/method.d.ts +1 -1
  77. package/lib/core/method.js +1 -1
  78. package/lib/data/DataManager.js +1 -1
  79. package/lib/data/connectSettings.d.ts +1 -1
  80. package/lib/data/firmwareInfo.js +0 -9
  81. package/lib/data/version.d.ts +1 -1
  82. package/lib/data/version.js +1 -1
  83. package/lib/device/AbortController.js +1 -1
  84. package/lib/device/DescriptorStream.js +1 -1
  85. package/lib/device/Device.js +1 -1
  86. package/lib/device/DeviceCommands.js +2 -2
  87. package/lib/device/DeviceList.js +6 -4
  88. package/lib/events/index.js +10 -10
  89. package/lib/exports.js +3 -3
  90. package/lib/factory.js +1 -0
  91. package/lib/index-browser.js +1 -1
  92. package/lib/index.js +2 -2
  93. package/lib/types/api/binance/index.d.ts +29 -0
  94. package/lib/types/api/binance/index.js +3 -0
  95. package/lib/types/api/binanceSignTransaction.d.ts +1 -27
  96. package/lib/types/api/bitcoin/index.d.ts +82 -0
  97. package/lib/types/api/bitcoin/index.js +3 -0
  98. package/lib/types/api/cardano/index.d.ts +193 -0
  99. package/lib/types/api/cardano/index.js +3 -0
  100. package/lib/types/api/cardanoGetAddress.d.ts +1 -31
  101. package/lib/types/api/cardanoGetNativeScriptHash.d.ts +1 -18
  102. package/lib/types/api/cardanoGetPublicKey.d.ts +1 -12
  103. package/lib/types/api/cardanoSignTransaction.d.ts +1 -127
  104. package/lib/types/api/eos/index.d.ts +119 -0
  105. package/lib/types/api/eos/index.js +3 -0
  106. package/lib/types/api/eosGetPublicKey.d.ts +1 -10
  107. package/lib/types/api/eosSignTransaction.d.ts +1 -107
  108. package/lib/types/api/ethereum/index.d.ts +86 -0
  109. package/lib/types/api/ethereum/index.js +3 -0
  110. package/lib/types/api/ethereumSignMessage.d.ts +1 -5
  111. package/lib/types/api/ethereumSignTransaction.d.ts +1 -37
  112. package/lib/types/api/ethereumSignTypedData.d.ts +1 -37
  113. package/lib/types/api/ethereumVerifyMessage.d.ts +1 -6
  114. package/lib/types/api/firmwareUpdate.d.ts +6 -3
  115. package/lib/types/api/getFirmwareHash.d.ts +4 -0
  116. package/lib/types/api/getFirmwareHash.js +3 -0
  117. package/lib/types/api/index.d.ts +2 -0
  118. package/lib/types/api/nem/index.d.ts +90 -0
  119. package/lib/types/api/nem/index.js +3 -0
  120. package/lib/types/api/nemSignTransaction.d.ts +2 -89
  121. package/lib/types/api/ripple/index.d.ts +21 -0
  122. package/lib/types/api/ripple/index.js +3 -0
  123. package/lib/types/api/rippleSignTransaction.d.ts +1 -20
  124. package/lib/types/api/signMessage.d.ts +1 -7
  125. package/lib/types/api/signTransaction.d.ts +1 -67
  126. package/lib/types/api/stellar/index.d.ts +180 -0
  127. package/lib/types/api/stellar/index.js +3 -0
  128. package/lib/types/api/stellarSignTransaction.d.ts +1 -179
  129. package/lib/types/api/tezos/index.d.ts +58 -0
  130. package/lib/types/api/tezos/index.js +3 -0
  131. package/lib/types/api/tezosSignTransaction.d.ts +1 -57
  132. package/lib/types/api/verifyMessage.d.ts +1 -7
  133. package/lib/types/index.d.ts +8 -4
  134. package/lib/types/index.js +15 -7
  135. package/lib/utils/__fixtures__/accountUtils.js +1 -1
  136. package/lib/utils/__fixtures__/ethereumUtils.js +1 -1
  137. package/lib/utils/__fixtures__/formatUtils.js +1 -1
  138. package/lib/utils/accountUtils.d.ts +2 -2
  139. package/lib/utils/assetUtils.d.ts +2 -0
  140. package/lib/utils/assetUtils.js +22 -0
  141. package/lib/utils/assets-browser.js +1 -1
  142. package/lib/utils/assets-native.d.ts +2 -0
  143. package/lib/utils/assets-native.js +7 -0
  144. package/lib/utils/assets.js +6 -14
  145. package/lib/utils/browserUtils.js +1 -1
  146. package/lib/utils/debug.d.ts +2 -2
  147. package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
  148. package/lib/utils/deviceFeaturesUtils.js +1 -1
  149. package/lib/utils/ethereumUtils.d.ts +1 -1
  150. package/lib/utils/formatUtils.js +1 -1
  151. package/lib/utils/hdnodeUtils.d.ts +1 -1
  152. package/lib/utils/pathUtils.d.ts +2 -2
  153. package/lib/workers/workers-browser.js +5 -5
  154. package/lib/workers/workers-react-native.js +4 -4
  155. package/lib/workers/workers.js +4 -4
  156. package/package.json +12 -9
  157. package/CHANGELOG.md +0 -26
@@ -0,0 +1,90 @@
1
+ import type { PROTO, NEM } from '../../../constants';
2
+ export interface MosaicID {
3
+ namespaceId: string;
4
+ name: string;
5
+ }
6
+ export interface MosaicDefinition {
7
+ levy?: {
8
+ type?: PROTO.NEMMosaicLevy;
9
+ fee?: number;
10
+ recipient?: string;
11
+ mosaicId?: MosaicID;
12
+ };
13
+ id: MosaicID;
14
+ description: string;
15
+ properties?: {
16
+ name: 'divisibility' | 'initialSupply' | 'supplyMutable' | 'transferable';
17
+ value: string;
18
+ }[];
19
+ }
20
+ export interface NEMMosaic {
21
+ mosaicId: MosaicID;
22
+ quantity: number;
23
+ }
24
+ export interface Modification {
25
+ modificationType: PROTO.NEMModificationType;
26
+ cosignatoryAccount: string;
27
+ }
28
+ export interface Message {
29
+ payload?: string;
30
+ type?: number;
31
+ publicKey?: string;
32
+ }
33
+ export interface TransactionCommon {
34
+ version: NEM.TxVersion;
35
+ timeStamp: number;
36
+ fee: number;
37
+ deadline: number;
38
+ signer?: string;
39
+ }
40
+ export declare type NEMTransferTransaction = TransactionCommon & {
41
+ type: NEM.TxType.TRANSFER;
42
+ recipient: string;
43
+ amount: PROTO.UintType;
44
+ mosaics?: NEMMosaic[];
45
+ message?: Message;
46
+ };
47
+ export declare type NEMImportanceTransaction = TransactionCommon & {
48
+ type: NEM.TxType.IMPORTANCE_TRANSFER;
49
+ importanceTransfer: {
50
+ mode: PROTO.NEMImportanceTransferMode;
51
+ publicKey: string;
52
+ };
53
+ };
54
+ export declare type NEMAggregateModificationTransaction = TransactionCommon & {
55
+ type: NEM.TxType.AGGREGATE_MODIFICATION;
56
+ modifications?: Modification[];
57
+ minCosignatories: {
58
+ relativeChange: number;
59
+ };
60
+ };
61
+ export declare type NEMProvisionNamespaceTransaction = TransactionCommon & {
62
+ type: NEM.TxType.PROVISION_NAMESPACE;
63
+ newPart: string;
64
+ parent?: string;
65
+ rentalFeeSink: string;
66
+ rentalFee: number;
67
+ };
68
+ export declare type NEMMosaicCreationTransaction = TransactionCommon & {
69
+ type: NEM.TxType.MOSAIC_CREATION;
70
+ mosaicDefinition: MosaicDefinition;
71
+ creationFeeSink: string;
72
+ creationFee: number;
73
+ };
74
+ export declare type NEMSupplyChangeTransaction = TransactionCommon & {
75
+ type: NEM.TxType.SUPPLY_CHANGE;
76
+ mosaicId: MosaicID;
77
+ supplyType: PROTO.NEMSupplyChangeType;
78
+ delta: number;
79
+ };
80
+ export declare type NEMRegularTransaction = NEMTransferTransaction | NEMImportanceTransaction | NEMAggregateModificationTransaction | NEMProvisionNamespaceTransaction | NEMMosaicCreationTransaction | NEMSupplyChangeTransaction;
81
+ export declare type NEMMultisigTransaction = TransactionCommon & {
82
+ type: NEM.TxType.COSIGNING | NEM.TxType.MULTISIG | NEM.TxType.MULTISIG_SIGNATURE;
83
+ otherTrans: NEMRegularTransaction;
84
+ };
85
+ export declare type NEMTransaction = NEMRegularTransaction | NEMMultisigTransaction;
86
+ export interface NEMSignTransaction {
87
+ path: string | number[];
88
+ transaction: NEMTransaction;
89
+ }
90
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -1,92 +1,5 @@
1
- import type { PROTO, NEM } from '../../constants';
1
+ import type { PROTO } from '../../constants';
2
2
  import type { Params, Response } from '../params';
3
- export interface MosaicID {
4
- namespaceId: string;
5
- name: string;
6
- }
7
- export interface MosaicDefinition {
8
- levy?: {
9
- type?: PROTO.NEMMosaicLevy;
10
- fee?: number;
11
- recipient?: string;
12
- mosaicId?: MosaicID;
13
- };
14
- id: MosaicID;
15
- description: string;
16
- properties?: {
17
- name: 'divisibility' | 'initialSupply' | 'supplyMutable' | 'transferable';
18
- value: string;
19
- }[];
20
- }
21
- export interface NEMMosaic {
22
- mosaicId: MosaicID;
23
- quantity: number;
24
- }
25
- export interface Modification {
26
- modificationType: PROTO.NEMModificationType;
27
- cosignatoryAccount: string;
28
- }
29
- export interface Message {
30
- payload?: string;
31
- type?: number;
32
- publicKey?: string;
33
- }
34
- export interface TransactionCommon {
35
- version: NEM.TxVersion;
36
- timeStamp: number;
37
- fee: number;
38
- deadline: number;
39
- signer?: string;
40
- }
41
- export declare type NEMTransferTransaction = TransactionCommon & {
42
- type: NEM.TxType.TRANSFER;
43
- recipient: string;
44
- amount: PROTO.UintType;
45
- mosaics?: NEMMosaic[];
46
- message?: Message;
47
- };
48
- export declare type NEMImportanceTransaction = TransactionCommon & {
49
- type: NEM.TxType.IMPORTANCE_TRANSFER;
50
- importanceTransfer: {
51
- mode: PROTO.NEMImportanceTransferMode;
52
- publicKey: string;
53
- };
54
- };
55
- export declare type NEMAggregateModificationTransaction = TransactionCommon & {
56
- type: NEM.TxType.AGGREGATE_MODIFICATION;
57
- modifications?: Modification[];
58
- minCosignatories: {
59
- relativeChange: number;
60
- };
61
- };
62
- export declare type NEMProvisionNamespaceTransaction = TransactionCommon & {
63
- type: NEM.TxType.PROVISION_NAMESPACE;
64
- newPart: string;
65
- parent?: string;
66
- rentalFeeSink: string;
67
- rentalFee: number;
68
- };
69
- export declare type NEMMosaicCreationTransaction = TransactionCommon & {
70
- type: NEM.TxType.MOSAIC_CREATION;
71
- mosaicDefinition: MosaicDefinition;
72
- creationFeeSink: string;
73
- creationFee: number;
74
- };
75
- export declare type NEMSupplyChangeTransaction = TransactionCommon & {
76
- type: NEM.TxType.SUPPLY_CHANGE;
77
- mosaicId: MosaicID;
78
- supplyType: PROTO.NEMSupplyChangeType;
79
- delta: number;
80
- };
81
- export declare type NEMRegularTransaction = NEMTransferTransaction | NEMImportanceTransaction | NEMAggregateModificationTransaction | NEMProvisionNamespaceTransaction | NEMMosaicCreationTransaction | NEMSupplyChangeTransaction;
82
- export declare type NEMMultisigTransaction = TransactionCommon & {
83
- type: NEM.TxType.COSIGNING | NEM.TxType.MULTISIG | NEM.TxType.MULTISIG_SIGNATURE;
84
- otherTrans: NEMRegularTransaction;
85
- };
86
- export declare type NEMTransaction = NEMRegularTransaction | NEMMultisigTransaction;
87
- export interface NEMSignTransaction {
88
- path: string | number[];
89
- transaction: NEMTransaction;
90
- }
3
+ import type { NEMSignTransaction } from './nem';
91
4
  export declare function nemSignTransaction(params: Params<NEMSignTransaction>): Response<PROTO.NEMSignedTx>;
92
5
  //# sourceMappingURL=nemSignTransaction.d.ts.map
@@ -0,0 +1,21 @@
1
+ export interface RipplePayment {
2
+ amount: string;
3
+ destination: string;
4
+ destinationTag?: number;
5
+ }
6
+ export interface RippleTransaction {
7
+ fee: string;
8
+ flags?: number;
9
+ sequence: number;
10
+ maxLedgerVersion?: number;
11
+ payment: RipplePayment;
12
+ }
13
+ export interface RippleSignTransaction {
14
+ path: string | number[];
15
+ transaction: RippleTransaction;
16
+ }
17
+ export interface RippleSignedTx {
18
+ serializedTx: string;
19
+ signature: string;
20
+ }
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -1,23 +1,4 @@
1
1
  import type { Params, Response } from '../params';
2
- export interface RipplePayment {
3
- amount: string;
4
- destination: string;
5
- destinationTag?: number;
6
- }
7
- export interface RippleTransaction {
8
- fee: string;
9
- flags?: number;
10
- sequence: number;
11
- maxLedgerVersion?: number;
12
- payment: RipplePayment;
13
- }
14
- export interface RippleSignTransaction {
15
- path: string | number[];
16
- transaction: RippleTransaction;
17
- }
18
- export interface RippleSignedTx {
19
- serializedTx: string;
20
- signature: string;
21
- }
2
+ import type { RippleSignTransaction, RippleSignedTx } from './ripple';
22
3
  export declare function rippleSignTransaction(params: Params<RippleSignTransaction>): Response<RippleSignedTx>;
23
4
  //# sourceMappingURL=rippleSignTransaction.d.ts.map
@@ -1,11 +1,5 @@
1
1
  import type { PROTO } from '../../constants';
2
2
  import type { Params, Response } from '../params';
3
- export interface SignMessage {
4
- path: string | number[];
5
- coin: string;
6
- message: string;
7
- hex?: boolean;
8
- no_script_type?: boolean;
9
- }
3
+ import type { SignMessage } from './bitcoin';
10
4
  export declare function signMessage(params: Params<SignMessage>): Response<PROTO.MessageSignature>;
11
5
  //# sourceMappingURL=signMessage.d.ts.map
@@ -1,70 +1,4 @@
1
- import type { AccountAddresses } from '@trezor/blockchain-link';
2
- import type { PROTO } from '../../constants';
3
1
  import type { Params, Response } from '../params';
4
- export declare type RefTransaction = {
5
- hash: string;
6
- version: number;
7
- inputs: PROTO.PrevInput[];
8
- bin_outputs: PROTO.TxOutputBinType[];
9
- outputs?: typeof undefined;
10
- lock_time: number;
11
- extra_data?: string;
12
- expiry?: number;
13
- overwintered?: boolean;
14
- version_group_id?: number;
15
- timestamp?: number;
16
- branch_id?: number;
17
- } | {
18
- hash: string;
19
- version: number;
20
- inputs: PROTO.TxInput[];
21
- bin_outputs?: typeof undefined;
22
- outputs: PROTO.TxOutputType[];
23
- lock_time: number;
24
- extra_data?: string;
25
- expiry?: number;
26
- overwintered?: boolean;
27
- version_group_id?: number;
28
- timestamp?: number;
29
- branch_id?: number;
30
- };
31
- export interface TransactionOptions {
32
- version?: number;
33
- lock_time?: number;
34
- expiry?: number;
35
- overwintered?: boolean;
36
- version_group_id?: number;
37
- timestamp?: number;
38
- branch_id?: number;
39
- decred_staking_ticket?: boolean;
40
- amount_unit?: PROTO.AmountUnit;
41
- }
42
- export interface SignTransaction {
43
- inputs: PROTO.TxInputType[];
44
- outputs: PROTO.TxOutputType[];
45
- paymentRequests?: PROTO.TxAckPaymentRequest[];
46
- refTxs?: RefTransaction[];
47
- account?: {
48
- addresses: AccountAddresses;
49
- };
50
- coin: string;
51
- locktime?: number;
52
- timestamp?: number;
53
- version?: number;
54
- expiry?: number;
55
- overwintered?: boolean;
56
- versionGroupId?: number;
57
- branchId?: number;
58
- decredStakingTicket?: boolean;
59
- push?: boolean;
60
- preauthorized?: boolean;
61
- amountUnit?: PROTO.AmountUnit;
62
- }
63
- export declare type SignedTransaction = {
64
- signatures: string[];
65
- serializedTx: string;
66
- witnesses?: (string | undefined)[];
67
- txid?: string;
68
- };
2
+ import type { SignTransaction, SignedTransaction } from './bitcoin';
69
3
  export declare function signTransaction(params: Params<SignTransaction>): Response<SignedTransaction>;
70
4
  //# sourceMappingURL=signTransaction.d.ts.map
@@ -0,0 +1,180 @@
1
+ /// <reference types="node" />
2
+ import type { PROTO } from '../../../constants';
3
+ export interface StellarAsset {
4
+ type: PROTO.StellarAssetType;
5
+ code?: string;
6
+ issuer?: string;
7
+ }
8
+ export interface StellarCreateAccountOperation {
9
+ type: 'createAccount';
10
+ source?: string;
11
+ destination: string;
12
+ startingBalance: string;
13
+ }
14
+ export interface StellarPaymentOperation {
15
+ type: 'payment';
16
+ source?: string;
17
+ destination: string;
18
+ asset: StellarAsset;
19
+ amount: string;
20
+ }
21
+ export interface StellarPathPaymentStrictReceiveOperation {
22
+ type: 'pathPaymentStrictReceive';
23
+ source?: string;
24
+ sendAsset: StellarAsset;
25
+ sendMax: string;
26
+ destination: string;
27
+ destAsset: StellarAsset;
28
+ destAmount: string;
29
+ path?: StellarAsset[];
30
+ }
31
+ export interface StellarPathPaymentStrictSendOperation {
32
+ type: 'pathPaymentStrictSend';
33
+ source?: string;
34
+ sendAsset: StellarAsset;
35
+ sendAmount: string;
36
+ destination: string;
37
+ destAsset: StellarAsset;
38
+ destMin: string;
39
+ path?: StellarAsset[];
40
+ }
41
+ export interface StellarPassiveSellOfferOperation {
42
+ type: 'createPassiveSellOffer';
43
+ source?: string;
44
+ buying: StellarAsset;
45
+ selling: StellarAsset;
46
+ amount: string;
47
+ price: {
48
+ n: number;
49
+ d: number;
50
+ };
51
+ }
52
+ export interface StellarManageSellOfferOperation {
53
+ type: 'manageSellOffer';
54
+ source?: string;
55
+ buying: StellarAsset;
56
+ selling: StellarAsset;
57
+ amount: string;
58
+ offerId?: string;
59
+ price: {
60
+ n: number;
61
+ d: number;
62
+ };
63
+ }
64
+ export interface StellarManageBuyOfferOperation {
65
+ type: 'manageBuyOffer';
66
+ source?: string;
67
+ buying: StellarAsset;
68
+ selling: StellarAsset;
69
+ amount: string;
70
+ offerId?: string;
71
+ price: {
72
+ n: number;
73
+ d: number;
74
+ };
75
+ }
76
+ export interface StellarSetOptionsOperation {
77
+ type: 'setOptions';
78
+ source?: string;
79
+ signer?: {
80
+ type: PROTO.StellarSignerType;
81
+ key: string | Buffer;
82
+ weight?: number;
83
+ };
84
+ inflationDest?: string;
85
+ clearFlags?: number;
86
+ setFlags?: number;
87
+ masterWeight?: PROTO.UintType;
88
+ lowThreshold?: PROTO.UintType;
89
+ medThreshold?: PROTO.UintType;
90
+ highThreshold?: PROTO.UintType;
91
+ homeDomain?: string;
92
+ }
93
+ export interface StellarChangeTrustOperation {
94
+ type: 'changeTrust';
95
+ source?: string;
96
+ line: StellarAsset;
97
+ limit: string;
98
+ }
99
+ export interface StellarAllowTrustOperation {
100
+ type: 'allowTrust';
101
+ source?: string;
102
+ trustor: string;
103
+ assetCode: string;
104
+ assetType: PROTO.StellarAssetType;
105
+ authorize?: boolean | typeof undefined;
106
+ }
107
+ export interface StellarAccountMergeOperation {
108
+ type: 'accountMerge';
109
+ source?: string;
110
+ destination: string;
111
+ }
112
+ export interface StellarManageDataOperation {
113
+ type: 'manageData';
114
+ source?: string;
115
+ name: string;
116
+ value?: string | Buffer;
117
+ }
118
+ export interface StellarBumpSequenceOperation {
119
+ type: 'bumpSequence';
120
+ source?: string;
121
+ bumpTo: string;
122
+ }
123
+ export interface StellarInflationOperation {
124
+ type: 'inflation';
125
+ source?: string;
126
+ }
127
+ export declare type StellarOperation = StellarCreateAccountOperation | StellarPaymentOperation | StellarPathPaymentStrictReceiveOperation | StellarPathPaymentStrictSendOperation | StellarPassiveSellOfferOperation | StellarManageSellOfferOperation | StellarManageBuyOfferOperation | StellarSetOptionsOperation | StellarChangeTrustOperation | StellarAllowTrustOperation | StellarAccountMergeOperation | StellarInflationOperation | StellarManageDataOperation | StellarBumpSequenceOperation;
128
+ export interface StellarTransaction {
129
+ source: string;
130
+ fee: number;
131
+ sequence: PROTO.UintType;
132
+ timebounds?: {
133
+ minTime: number;
134
+ maxTime: number;
135
+ };
136
+ memo?: {
137
+ type: PROTO.StellarMemoType;
138
+ id?: string;
139
+ text?: string;
140
+ hash?: string | Buffer;
141
+ };
142
+ operations: StellarOperation[];
143
+ }
144
+ export interface StellarSignTransaction {
145
+ path: string | number[];
146
+ networkPassphrase: string;
147
+ transaction: StellarTransaction;
148
+ }
149
+ export interface StellarSignedTx {
150
+ publicKey: string;
151
+ signature: string;
152
+ }
153
+ export declare type StellarOperationMessage = ({
154
+ type: 'StellarCreateAccountOp';
155
+ } & PROTO.StellarCreateAccountOp) | ({
156
+ type: 'StellarPaymentOp';
157
+ } & PROTO.StellarPaymentOp) | ({
158
+ type: 'StellarPathPaymentStrictReceiveOp';
159
+ } & PROTO.StellarPathPaymentStrictReceiveOp) | ({
160
+ type: 'StellarPathPaymentStrictSendOp';
161
+ } & PROTO.StellarPathPaymentStrictSendOp) | ({
162
+ type: 'StellarManageSellOfferOp';
163
+ } & PROTO.StellarManageSellOfferOp) | ({
164
+ type: 'StellarManageBuyOfferOp';
165
+ } & PROTO.StellarManageBuyOfferOp) | ({
166
+ type: 'StellarCreatePassiveSellOfferOp';
167
+ } & PROTO.StellarCreatePassiveSellOfferOp) | ({
168
+ type: 'StellarSetOptionsOp';
169
+ } & PROTO.StellarSetOptionsOp) | ({
170
+ type: 'StellarChangeTrustOp';
171
+ } & PROTO.StellarChangeTrustOp) | ({
172
+ type: 'StellarAllowTrustOp';
173
+ } & PROTO.StellarAllowTrustOp) | ({
174
+ type: 'StellarAccountMergeOp';
175
+ } & PROTO.StellarAccountMergeOp) | ({
176
+ type: 'StellarManageDataOp';
177
+ } & PROTO.StellarManageDataOp) | ({
178
+ type: 'StellarBumpSequenceOp';
179
+ } & PROTO.StellarBumpSequenceOp);
180
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -1,182 +1,4 @@
1
- /// <reference types="node" />
2
- import type { PROTO } from '../../constants';
3
1
  import type { Params, Response } from '../params';
4
- export interface StellarAsset {
5
- type: PROTO.StellarAssetType;
6
- code?: string;
7
- issuer?: string;
8
- }
9
- export interface StellarCreateAccountOperation {
10
- type: 'createAccount';
11
- source?: string;
12
- destination: string;
13
- startingBalance: string;
14
- }
15
- export interface StellarPaymentOperation {
16
- type: 'payment';
17
- source?: string;
18
- destination: string;
19
- asset: StellarAsset;
20
- amount: string;
21
- }
22
- export interface StellarPathPaymentStrictReceiveOperation {
23
- type: 'pathPaymentStrictReceive';
24
- source?: string;
25
- sendAsset: StellarAsset;
26
- sendMax: string;
27
- destination: string;
28
- destAsset: StellarAsset;
29
- destAmount: string;
30
- path?: StellarAsset[];
31
- }
32
- export interface StellarPathPaymentStrictSendOperation {
33
- type: 'pathPaymentStrictSend';
34
- source?: string;
35
- sendAsset: StellarAsset;
36
- sendAmount: string;
37
- destination: string;
38
- destAsset: StellarAsset;
39
- destMin: string;
40
- path?: StellarAsset[];
41
- }
42
- export interface StellarPassiveSellOfferOperation {
43
- type: 'createPassiveSellOffer';
44
- source?: string;
45
- buying: StellarAsset;
46
- selling: StellarAsset;
47
- amount: string;
48
- price: {
49
- n: number;
50
- d: number;
51
- };
52
- }
53
- export interface StellarManageSellOfferOperation {
54
- type: 'manageSellOffer';
55
- source?: string;
56
- buying: StellarAsset;
57
- selling: StellarAsset;
58
- amount: string;
59
- offerId?: string;
60
- price: {
61
- n: number;
62
- d: number;
63
- };
64
- }
65
- export interface StellarManageBuyOfferOperation {
66
- type: 'manageBuyOffer';
67
- source?: string;
68
- buying: StellarAsset;
69
- selling: StellarAsset;
70
- amount: string;
71
- offerId?: string;
72
- price: {
73
- n: number;
74
- d: number;
75
- };
76
- }
77
- export interface StellarSetOptionsOperation {
78
- type: 'setOptions';
79
- source?: string;
80
- signer?: {
81
- type: PROTO.StellarSignerType;
82
- key: string | Buffer;
83
- weight?: number;
84
- };
85
- inflationDest?: string;
86
- clearFlags?: number;
87
- setFlags?: number;
88
- masterWeight?: PROTO.UintType;
89
- lowThreshold?: PROTO.UintType;
90
- medThreshold?: PROTO.UintType;
91
- highThreshold?: PROTO.UintType;
92
- homeDomain?: string;
93
- }
94
- export interface StellarChangeTrustOperation {
95
- type: 'changeTrust';
96
- source?: string;
97
- line: StellarAsset;
98
- limit: string;
99
- }
100
- export interface StellarAllowTrustOperation {
101
- type: 'allowTrust';
102
- source?: string;
103
- trustor: string;
104
- assetCode: string;
105
- assetType: PROTO.StellarAssetType;
106
- authorize?: boolean | typeof undefined;
107
- }
108
- export interface StellarAccountMergeOperation {
109
- type: 'accountMerge';
110
- source?: string;
111
- destination: string;
112
- }
113
- export interface StellarManageDataOperation {
114
- type: 'manageData';
115
- source?: string;
116
- name: string;
117
- value?: string | Buffer;
118
- }
119
- export interface StellarBumpSequenceOperation {
120
- type: 'bumpSequence';
121
- source?: string;
122
- bumpTo: string;
123
- }
124
- export interface StellarInflationOperation {
125
- type: 'inflation';
126
- source?: string;
127
- }
128
- export declare type StellarOperation = StellarCreateAccountOperation | StellarPaymentOperation | StellarPathPaymentStrictReceiveOperation | StellarPathPaymentStrictSendOperation | StellarPassiveSellOfferOperation | StellarManageSellOfferOperation | StellarManageBuyOfferOperation | StellarSetOptionsOperation | StellarChangeTrustOperation | StellarAllowTrustOperation | StellarAccountMergeOperation | StellarInflationOperation | StellarManageDataOperation | StellarBumpSequenceOperation;
129
- export interface StellarTransaction {
130
- source: string;
131
- fee: number;
132
- sequence: PROTO.UintType;
133
- timebounds?: {
134
- minTime: number;
135
- maxTime: number;
136
- };
137
- memo?: {
138
- type: PROTO.StellarMemoType;
139
- id?: string;
140
- text?: string;
141
- hash?: string | Buffer;
142
- };
143
- operations: StellarOperation[];
144
- }
145
- export interface StellarSignTransaction {
146
- path: string | number[];
147
- networkPassphrase: string;
148
- transaction: StellarTransaction;
149
- }
150
- export interface StellarSignedTx {
151
- publicKey: string;
152
- signature: string;
153
- }
154
- export declare type StellarOperationMessage = ({
155
- type: 'StellarCreateAccountOp';
156
- } & PROTO.StellarCreateAccountOp) | ({
157
- type: 'StellarPaymentOp';
158
- } & PROTO.StellarPaymentOp) | ({
159
- type: 'StellarPathPaymentStrictReceiveOp';
160
- } & PROTO.StellarPathPaymentStrictReceiveOp) | ({
161
- type: 'StellarPathPaymentStrictSendOp';
162
- } & PROTO.StellarPathPaymentStrictSendOp) | ({
163
- type: 'StellarManageSellOfferOp';
164
- } & PROTO.StellarManageSellOfferOp) | ({
165
- type: 'StellarManageBuyOfferOp';
166
- } & PROTO.StellarManageBuyOfferOp) | ({
167
- type: 'StellarCreatePassiveSellOfferOp';
168
- } & PROTO.StellarCreatePassiveSellOfferOp) | ({
169
- type: 'StellarSetOptionsOp';
170
- } & PROTO.StellarSetOptionsOp) | ({
171
- type: 'StellarChangeTrustOp';
172
- } & PROTO.StellarChangeTrustOp) | ({
173
- type: 'StellarAllowTrustOp';
174
- } & PROTO.StellarAllowTrustOp) | ({
175
- type: 'StellarAccountMergeOp';
176
- } & PROTO.StellarAccountMergeOp) | ({
177
- type: 'StellarManageDataOp';
178
- } & PROTO.StellarManageDataOp) | ({
179
- type: 'StellarBumpSequenceOp';
180
- } & PROTO.StellarBumpSequenceOp);
2
+ import type { StellarSignTransaction, StellarSignedTx } from './stellar';
181
3
  export declare function stellarSignTransaction(params: Params<StellarSignTransaction>): Response<StellarSignedTx>;
182
4
  //# sourceMappingURL=stellarSignTransaction.d.ts.map