@amadeus-protocol/sdk 1.0.5 → 1.0.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.
- package/README.md +2 -2
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/contract-state.d.ts +59 -0
- package/dist/contract-state.d.ts.map +1 -0
- package/dist/contract-state.js +117 -0
- package/dist/contract-state.js.map +1 -0
- package/dist/contracts/abi-types.d.ts +87 -0
- package/dist/contracts/abi-types.d.ts.map +1 -0
- package/dist/contracts/abi-types.js +8 -0
- package/dist/contracts/abi-types.js.map +1 -0
- package/dist/contracts/coin.d.ts +42 -0
- package/dist/contracts/coin.d.ts.map +1 -0
- package/dist/contracts/coin.js +42 -0
- package/dist/contracts/coin.js.map +1 -0
- package/dist/contracts/contract-call.d.ts +49 -0
- package/dist/contracts/contract-call.d.ts.map +1 -0
- package/dist/contracts/contract-call.js +57 -0
- package/dist/contracts/contract-call.js.map +1 -0
- package/dist/contracts/contract.d.ts +113 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +107 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/lockup/abi.d.ts +62 -0
- package/dist/contracts/lockup/abi.d.ts.map +1 -0
- package/dist/contracts/lockup/abi.js +77 -0
- package/dist/contracts/lockup/abi.js.map +1 -0
- package/dist/contracts/lockup/calls.d.ts +23 -0
- package/dist/contracts/lockup/calls.d.ts.map +1 -0
- package/dist/contracts/lockup/calls.js +25 -0
- package/dist/contracts/lockup/calls.js.map +1 -0
- package/dist/contracts/lockup/helpers.d.ts +24 -0
- package/dist/contracts/lockup/helpers.d.ts.map +1 -0
- package/dist/contracts/lockup/helpers.js +49 -0
- package/dist/contracts/lockup/helpers.js.map +1 -0
- package/dist/contracts/lockup/index.d.ts +6 -0
- package/dist/contracts/lockup/index.d.ts.map +1 -0
- package/dist/contracts/lockup/index.js +6 -0
- package/dist/contracts/lockup/index.js.map +1 -0
- package/dist/contracts/lockup/parsers.d.ts +20 -0
- package/dist/contracts/lockup/parsers.d.ts.map +1 -0
- package/dist/contracts/lockup/parsers.js +60 -0
- package/dist/contracts/lockup/parsers.js.map +1 -0
- package/dist/contracts/lockup/storage-keys.d.ts +15 -0
- package/dist/contracts/lockup/storage-keys.d.ts.map +1 -0
- package/dist/contracts/lockup/storage-keys.js +78 -0
- package/dist/contracts/lockup/storage-keys.js.map +1 -0
- package/dist/contracts/lockup/types.d.ts +90 -0
- package/dist/contracts/lockup/types.d.ts.map +1 -0
- package/dist/contracts/lockup/types.js +7 -0
- package/dist/contracts/lockup/types.js.map +1 -0
- package/dist/contracts/lockup-prime/abi.d.ts +348 -0
- package/dist/contracts/lockup-prime/abi.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/abi.js +420 -0
- package/dist/contracts/lockup-prime/abi.js.map +1 -0
- package/dist/contracts/lockup-prime/calls.d.ts +53 -0
- package/dist/contracts/lockup-prime/calls.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/calls.js +60 -0
- package/dist/contracts/lockup-prime/calls.js.map +1 -0
- package/dist/contracts/lockup-prime/helpers.d.ts +38 -0
- package/dist/contracts/lockup-prime/helpers.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/helpers.js +147 -0
- package/dist/contracts/lockup-prime/helpers.js.map +1 -0
- package/dist/contracts/lockup-prime/index.d.ts +6 -0
- package/dist/contracts/lockup-prime/index.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/index.js +6 -0
- package/dist/contracts/lockup-prime/index.js.map +1 -0
- package/dist/contracts/lockup-prime/parsers.d.ts +25 -0
- package/dist/contracts/lockup-prime/parsers.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/parsers.js +68 -0
- package/dist/contracts/lockup-prime/parsers.js.map +1 -0
- package/dist/contracts/lockup-prime/storage-keys.d.ts +25 -0
- package/dist/contracts/lockup-prime/storage-keys.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/storage-keys.js +92 -0
- package/dist/contracts/lockup-prime/storage-keys.js.map +1 -0
- package/dist/contracts/lockup-prime/types.d.ts +116 -0
- package/dist/contracts/lockup-prime/types.d.ts.map +1 -0
- package/dist/contracts/lockup-prime/types.js +18 -0
- package/dist/contracts/lockup-prime/types.js.map +1 -0
- package/dist/crypto.js +1 -1
- package/dist/crypto.js.map +1 -1
- package/dist/formatters.d.ts +1 -1
- package/dist/formatters.d.ts.map +1 -1
- package/dist/formatters.js +2 -2
- package/dist/formatters.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/serialization.d.ts +22 -0
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +39 -2
- package/dist/serialization.js.map +1 -1
- package/dist/signing.d.ts +39 -0
- package/dist/signing.d.ts.map +1 -0
- package/dist/signing.js +84 -0
- package/dist/signing.js.map +1 -0
- package/dist/transaction-builder.d.ts +135 -194
- package/dist/transaction-builder.d.ts.map +1 -1
- package/dist/transaction-builder.js +237 -288
- package/dist/transaction-builder.js.map +1 -1
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Transaction Builder
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Class-based API for building and signing Amadeus protocol transactions.
|
|
5
|
+
* Delegates to the signing primitives in `signing.ts` and the ABI-driven
|
|
6
|
+
* contract factory in `contracts/contract.ts`.
|
|
7
|
+
*
|
|
8
|
+
* ## Recommended: ABI-driven API
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { TransactionBuilder, LOCKUP_PRIME_ABI, toAtomicAma } from '@amadeus-protocol/sdk'
|
|
12
|
+
*
|
|
13
|
+
* // Via builder.contract(abi) — typed methods, auto-signed:
|
|
14
|
+
* const builder = new TransactionBuilder('5Kd3N...')
|
|
15
|
+
* const result = builder.contract(LOCKUP_PRIME_ABI).lock({
|
|
16
|
+
* amount: toAtomicAma(100).toString(),
|
|
17
|
+
* tier: '30d'
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* // Or standalone:
|
|
21
|
+
* import { createContract } from '@amadeus-protocol/sdk'
|
|
22
|
+
* const lockupPrime = createContract(LOCKUP_PRIME_ABI)
|
|
23
|
+
* const call = lockupPrime.lock({ amount: toAtomicAma(100).toString(), tier: '30d' })
|
|
24
|
+
* const result = TransactionBuilder.signCall('5Kd3N...', call)
|
|
25
|
+
* ```
|
|
5
26
|
*/
|
|
6
|
-
import type { PrivKey } from '@noble/curves/utils';
|
|
7
|
-
import type { BuildTransactionResult, SerializableValue, TransferTransactionInput, UnsignedTransactionWithHash } from './types';
|
|
27
|
+
import type { PrivKey } from '@noble/curves/abstract/utils';
|
|
28
|
+
import type { BuildTransactionResult, LockupPrimeDailyCheckinInput, LockupPrimeLockInput, LockupPrimeUnlockInput, LockupUnlockInput, SerializableValue, TransferTransactionInput, UnsignedTransactionWithHash } from './types';
|
|
29
|
+
import type { AbiDefinition } from './contracts/abi-types';
|
|
30
|
+
import type { ContractCall } from './contracts/contract-call';
|
|
31
|
+
import { type SignedContract } from './contracts/contract';
|
|
8
32
|
/**
|
|
9
33
|
* Transaction Builder for Amadeus Protocol
|
|
10
34
|
*
|
|
@@ -13,31 +37,24 @@ import type { BuildTransactionResult, SerializableValue, TransferTransactionInpu
|
|
|
13
37
|
*
|
|
14
38
|
* @example
|
|
15
39
|
* ```ts
|
|
16
|
-
* //
|
|
40
|
+
* // ABI-driven (recommended)
|
|
17
41
|
* const builder = new TransactionBuilder('5Kd3N...')
|
|
18
|
-
* const
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* symbol: 'AMA'
|
|
42
|
+
* const result = builder.contract(LOCKUP_PRIME_ABI).lock({
|
|
43
|
+
* amount: toAtomicAma(100).toString(),
|
|
44
|
+
* tier: '30d'
|
|
22
45
|
* })
|
|
23
46
|
*
|
|
24
|
-
* //
|
|
25
|
-
* const
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* symbol: 'AMA'
|
|
30
|
-
* })
|
|
47
|
+
* // Generic build/sign
|
|
48
|
+
* const builder = new TransactionBuilder('5Kd3N...')
|
|
49
|
+
* const { txHash, txPacked } = builder.buildAndSign('Coin', 'transfer', [
|
|
50
|
+
* recipientBytes, '1000000000', 'AMA'
|
|
51
|
+
* ])
|
|
31
52
|
* ```
|
|
32
53
|
*/
|
|
33
54
|
export declare class TransactionBuilder {
|
|
34
55
|
private readonly privateKey;
|
|
35
56
|
private signerPk;
|
|
36
57
|
private signerSk;
|
|
37
|
-
/**
|
|
38
|
-
* Domain Separation Tag for transaction signatures
|
|
39
|
-
*/
|
|
40
|
-
private static readonly TX_DST;
|
|
41
58
|
/**
|
|
42
59
|
* Create a new TransactionBuilder instance
|
|
43
60
|
*
|
|
@@ -45,223 +62,147 @@ export declare class TransactionBuilder {
|
|
|
45
62
|
* the builder will use this key for all transactions.
|
|
46
63
|
*/
|
|
47
64
|
constructor(privateKey?: string);
|
|
48
|
-
/**
|
|
49
|
-
* Generate a transaction nonce based on current timestamp
|
|
50
|
-
*/
|
|
51
|
-
private static generateNonce;
|
|
52
|
-
/**
|
|
53
|
-
* Create transaction structure
|
|
54
|
-
*/
|
|
55
|
-
private static createTransaction;
|
|
56
|
-
/**
|
|
57
|
-
* Build an unsigned transaction (returns transaction structure and hash)
|
|
58
|
-
*/
|
|
59
|
-
private static buildUnsignedTransaction;
|
|
60
|
-
/**
|
|
61
|
-
* Normalize signer secret key to PrivKey format (handles Base58 strings)
|
|
62
|
-
*/
|
|
63
|
-
private static normalizeSignerSk;
|
|
64
|
-
/**
|
|
65
|
-
* Sign a transaction hash using BLS12-381 with transaction DST
|
|
66
|
-
*/
|
|
67
|
-
private static signHash;
|
|
68
|
-
/**
|
|
69
|
-
* Sign an unsigned transaction
|
|
70
|
-
*/
|
|
71
|
-
private static signTransaction;
|
|
72
|
-
/**
|
|
73
|
-
* Build and sign a transaction (convenience method)
|
|
74
|
-
*/
|
|
75
|
-
private static buildAndSignTransaction;
|
|
76
65
|
/**
|
|
77
66
|
* Initialize signer keys from the private key
|
|
78
67
|
*/
|
|
79
68
|
private initializeKeys;
|
|
80
|
-
/**
|
|
81
|
-
* Build an unsigned transaction
|
|
82
|
-
*
|
|
83
|
-
* @param contract - Contract name
|
|
84
|
-
* @param method - Method name
|
|
85
|
-
* @param args - Method arguments
|
|
86
|
-
* @param signerPk - Optional signer's public key (required if instance has no private key)
|
|
87
|
-
* @returns Unsigned transaction with hash
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```ts
|
|
91
|
-
* const builder = new TransactionBuilder('5Kd3N...')
|
|
92
|
-
* const unsignedTx = builder.build('Coin', 'transfer', [
|
|
93
|
-
* recipientBytes,
|
|
94
|
-
* '1000000000',
|
|
95
|
-
* 'AMA'
|
|
96
|
-
* ])
|
|
97
|
-
* // Can inspect or modify before signing
|
|
98
|
-
* const { txHash, txPacked } = builder.sign(unsignedTx)
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
build(contract: string, method: string, args: SerializableValue[], signerPk?: Uint8Array): UnsignedTransactionWithHash;
|
|
102
69
|
/**
|
|
103
70
|
* Get the signer's secret key (normalizes to PrivKey format)
|
|
104
|
-
* Handles Base58 strings, PrivKey (Uint8Array), or uses cached/derived key
|
|
105
71
|
*/
|
|
106
72
|
private getSignerSk;
|
|
73
|
+
private requirePk;
|
|
107
74
|
/**
|
|
108
|
-
*
|
|
75
|
+
* Get a typed, signer-bound contract interface from an ABI definition.
|
|
109
76
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
77
|
+
* Each ABI function becomes a method that builds and signs in one step,
|
|
78
|
+
* returning `BuildTransactionResult` directly.
|
|
79
|
+
*
|
|
80
|
+
* @param abi - An ABI definition object (declared `as const`)
|
|
81
|
+
* @returns A `SignedContract<TAbi>` with typed methods for each ABI function
|
|
113
82
|
*
|
|
114
83
|
* @example
|
|
115
84
|
* ```ts
|
|
116
85
|
* const builder = new TransactionBuilder('5Kd3N...')
|
|
117
|
-
*
|
|
118
|
-
*
|
|
86
|
+
*
|
|
87
|
+
* // LockupPrime — all methods auto-detected from ABI:
|
|
88
|
+
* const result = builder.contract(LOCKUP_PRIME_ABI).lock({
|
|
89
|
+
* amount: toAtomicAma(100).toString(),
|
|
90
|
+
* tier: '30d'
|
|
91
|
+
* })
|
|
92
|
+
*
|
|
93
|
+
* builder.contract(LOCKUP_PRIME_ABI).unlock({ vaultIndex: '3' })
|
|
94
|
+
* builder.contract(LOCKUP_PRIME_ABI).daily_checkin({ vaultIndex: '7' })
|
|
95
|
+
*
|
|
96
|
+
* // Lockup:
|
|
97
|
+
* builder.contract(LOCKUP_ABI).unlock({ vaultIndex: '5' })
|
|
98
|
+
*
|
|
99
|
+
* // Any future contract — just pass its ABI:
|
|
100
|
+
* builder.contract(SOME_NEW_ABI).someFunction({ param: 'value' })
|
|
119
101
|
* ```
|
|
120
102
|
*/
|
|
121
|
-
|
|
103
|
+
contract<TAbi extends AbiDefinition>(abi: TAbi): SignedContract<TAbi>;
|
|
122
104
|
/**
|
|
123
|
-
*
|
|
105
|
+
* Derive keys from a Base58 private key and sign a ContractCall.
|
|
124
106
|
*
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
127
|
-
* @param args - Method arguments
|
|
128
|
-
* @param signerPk - Optional signer's public key (required if instance has no private key)
|
|
129
|
-
* @param signerSk - Optional signer's secret key (required if instance has no private key)
|
|
107
|
+
* @param senderPrivkey - Base58 encoded private key (seed)
|
|
108
|
+
* @param call - A ContractCall from createContract(), buildContractCall(), or buildCoinTransfer()
|
|
130
109
|
* @returns Transaction hash and packed transaction
|
|
131
110
|
*
|
|
132
111
|
* @example
|
|
133
112
|
* ```ts
|
|
134
|
-
* const
|
|
135
|
-
* const
|
|
136
|
-
*
|
|
137
|
-
* '1000000000',
|
|
138
|
-
* 'AMA'
|
|
139
|
-
* ])
|
|
113
|
+
* const lockupPrime = createContract(LOCKUP_PRIME_ABI)
|
|
114
|
+
* const call = lockupPrime.lock({ amount: '100000000000', tier: '30d' })
|
|
115
|
+
* const { txHash, txPacked } = TransactionBuilder.signCall('5Kd3N...', call)
|
|
140
116
|
* ```
|
|
141
117
|
*/
|
|
118
|
+
static signCall(senderPrivkey: string, call: ContractCall): BuildTransactionResult;
|
|
119
|
+
/**
|
|
120
|
+
* Build an unsigned transaction from a ContractCall (static)
|
|
121
|
+
*/
|
|
122
|
+
static buildFromCall(call: ContractCall, signerPk: Uint8Array): UnsignedTransactionWithHash;
|
|
123
|
+
/**
|
|
124
|
+
* Build and sign a transaction from a ContractCall (static)
|
|
125
|
+
*/
|
|
126
|
+
static buildAndSignCall(signerPk: Uint8Array, signerSk: PrivKey | string | Uint8Array, call: ContractCall): BuildTransactionResult;
|
|
127
|
+
/**
|
|
128
|
+
* Build an unsigned transaction from a ContractCall (instance)
|
|
129
|
+
*/
|
|
130
|
+
buildFromCall(call: ContractCall): UnsignedTransactionWithHash;
|
|
131
|
+
/**
|
|
132
|
+
* Build and sign a transaction from a ContractCall (instance)
|
|
133
|
+
*/
|
|
134
|
+
buildAndSignCall(call: ContractCall): BuildTransactionResult;
|
|
135
|
+
/**
|
|
136
|
+
* Build an unsigned transaction (instance)
|
|
137
|
+
*/
|
|
138
|
+
build(contract: string, method: string, args: SerializableValue[], signerPk?: Uint8Array): UnsignedTransactionWithHash;
|
|
139
|
+
/**
|
|
140
|
+
* Sign an unsigned transaction (instance)
|
|
141
|
+
*/
|
|
142
|
+
sign(unsignedTx: UnsignedTransactionWithHash, signerSk?: PrivKey | string | Uint8Array): BuildTransactionResult;
|
|
143
|
+
/**
|
|
144
|
+
* Build and sign a generic transaction (instance)
|
|
145
|
+
*/
|
|
142
146
|
buildAndSign(contract: string, method: string, args: SerializableValue[], signerPk?: Uint8Array, signerSk?: PrivKey | string | Uint8Array): BuildTransactionResult;
|
|
143
147
|
/**
|
|
144
|
-
* Build an unsigned
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
*
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
*
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
*
|
|
157
|
-
* ```
|
|
148
|
+
* Build an unsigned transaction (static)
|
|
149
|
+
*/
|
|
150
|
+
static build(signerPk: Uint8Array, contract: string, method: string, args: SerializableValue[]): UnsignedTransactionWithHash;
|
|
151
|
+
/**
|
|
152
|
+
* Sign an unsigned transaction (static)
|
|
153
|
+
*/
|
|
154
|
+
static sign(unsignedTx: UnsignedTransactionWithHash, signerSk: PrivKey | string | Uint8Array): BuildTransactionResult;
|
|
155
|
+
/**
|
|
156
|
+
* Build and sign a generic transaction (static)
|
|
157
|
+
*/
|
|
158
|
+
static buildAndSign(signerPk: Uint8Array, signerSk: PrivKey | string | Uint8Array, contract: string, method: string, args: SerializableValue[]): BuildTransactionResult;
|
|
159
|
+
/**
|
|
160
|
+
* Build an unsigned Coin transfer transaction
|
|
158
161
|
*/
|
|
159
162
|
buildTransfer(input: Omit<TransferTransactionInput, 'senderPrivkey'>): UnsignedTransactionWithHash;
|
|
160
163
|
/**
|
|
161
|
-
* Build and sign a transfer transaction
|
|
162
|
-
*
|
|
163
|
-
* @param input - Transfer transaction parameters
|
|
164
|
-
* @returns Transaction hash and packed transaction
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```ts
|
|
168
|
-
* const builder = new TransactionBuilder('5Kd3N...')
|
|
169
|
-
* const { txHash, txPacked } = builder.transfer({
|
|
170
|
-
* recipient: '5Kd3N...',
|
|
171
|
-
* amount: 10.5,
|
|
172
|
-
* symbol: 'AMA'
|
|
173
|
-
* })
|
|
174
|
-
* ```
|
|
164
|
+
* Build and sign a Coin transfer transaction
|
|
175
165
|
*/
|
|
176
166
|
transfer(input: Omit<TransferTransactionInput, 'senderPrivkey'>): BuildTransactionResult;
|
|
177
167
|
/**
|
|
178
|
-
* Build an unsigned transfer transaction (static
|
|
179
|
-
*
|
|
180
|
-
* @param input - Transfer transaction parameters (without senderPrivkey)
|
|
181
|
-
* @param signerPk - Signer's public key
|
|
182
|
-
* @returns Unsigned transaction with hash
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* const unsignedTx = TransactionBuilder.buildTransfer(
|
|
187
|
-
* { recipient: '5Kd3N...', amount: 10.5, symbol: 'AMA' },
|
|
188
|
-
* publicKey
|
|
189
|
-
* )
|
|
190
|
-
* ```
|
|
168
|
+
* Build an unsigned Coin transfer transaction (static)
|
|
191
169
|
*/
|
|
192
170
|
static buildTransfer(input: Omit<TransferTransactionInput, 'senderPrivkey'>, signerPk: Uint8Array): UnsignedTransactionWithHash;
|
|
193
171
|
/**
|
|
194
|
-
* Build and sign a transfer transaction (static
|
|
195
|
-
*
|
|
196
|
-
* @param input - Transfer transaction parameters
|
|
197
|
-
* @returns Transaction hash and packed transaction
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```ts
|
|
201
|
-
* const { txHash, txPacked } = TransactionBuilder.buildSignedTransfer({
|
|
202
|
-
* senderPrivkey: '5Kd3N...',
|
|
203
|
-
* recipient: '5Kd3N...',
|
|
204
|
-
* amount: 10.5,
|
|
205
|
-
* symbol: 'AMA'
|
|
206
|
-
* })
|
|
207
|
-
* ```
|
|
172
|
+
* Build and sign a Coin transfer transaction (static)
|
|
208
173
|
*/
|
|
209
174
|
static buildSignedTransfer(input: TransferTransactionInput): BuildTransactionResult;
|
|
210
175
|
/**
|
|
211
|
-
* Build
|
|
212
|
-
*
|
|
213
|
-
* @param signerPk - Signer's public key
|
|
214
|
-
* @param contract - Contract name
|
|
215
|
-
* @param method - Method name
|
|
216
|
-
* @param args - Method arguments
|
|
217
|
-
* @returns Unsigned transaction with hash
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* ```ts
|
|
221
|
-
* const unsignedTx = TransactionBuilder.build(
|
|
222
|
-
* publicKey,
|
|
223
|
-
* 'Coin',
|
|
224
|
-
* 'transfer',
|
|
225
|
-
* [recipientBytes, amount, 'AMA']
|
|
226
|
-
* )
|
|
227
|
-
* ```
|
|
176
|
+
* Build and sign a LockupPrime lock transaction
|
|
228
177
|
*/
|
|
229
|
-
|
|
178
|
+
lockupPrimeLock(input: Omit<LockupPrimeLockInput, 'senderPrivkey'>): BuildTransactionResult;
|
|
230
179
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* @param unsignedTx - Unsigned transaction with hash
|
|
234
|
-
* @param signerSk - Signer's secret key
|
|
235
|
-
* @returns Transaction hash and packed transaction
|
|
236
|
-
*
|
|
237
|
-
* @example
|
|
238
|
-
* ```ts
|
|
239
|
-
* const unsignedTx = TransactionBuilder.build(publicKey, 'Coin', 'transfer', args)
|
|
240
|
-
* const { txHash, txPacked } = TransactionBuilder.sign(unsignedTx, secretKey)
|
|
241
|
-
* ```
|
|
180
|
+
* Build and sign a LockupPrime unlock transaction
|
|
242
181
|
*/
|
|
243
|
-
|
|
182
|
+
lockupPrimeUnlock(input: Omit<LockupPrimeUnlockInput, 'senderPrivkey'>): BuildTransactionResult;
|
|
244
183
|
/**
|
|
245
|
-
* Build and sign a
|
|
246
|
-
*
|
|
247
|
-
* @param signerPk - Signer's public key
|
|
248
|
-
* @param signerSk - Signer's secret key
|
|
249
|
-
* @param contract - Contract name
|
|
250
|
-
* @param method - Method name
|
|
251
|
-
* @param args - Method arguments
|
|
252
|
-
* @returns Transaction hash and packed transaction
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* ```ts
|
|
256
|
-
* const { txHash, txPacked } = TransactionBuilder.buildAndSign(
|
|
257
|
-
* publicKey,
|
|
258
|
-
* secretKey,
|
|
259
|
-
* 'Coin',
|
|
260
|
-
* 'transfer',
|
|
261
|
-
* [recipientBytes, amount, 'AMA']
|
|
262
|
-
* )
|
|
263
|
-
* ```
|
|
184
|
+
* Build and sign a LockupPrime daily check-in transaction
|
|
264
185
|
*/
|
|
265
|
-
|
|
186
|
+
lockupPrimeDailyCheckin(input: Omit<LockupPrimeDailyCheckinInput, 'senderPrivkey'>): BuildTransactionResult;
|
|
187
|
+
/**
|
|
188
|
+
* Build and sign a Lockup unlock transaction
|
|
189
|
+
*/
|
|
190
|
+
lockupUnlock(input: Omit<LockupUnlockInput, 'senderPrivkey'>): BuildTransactionResult;
|
|
191
|
+
/**
|
|
192
|
+
* Build and sign a LockupPrime lock transaction (static)
|
|
193
|
+
*/
|
|
194
|
+
static buildSignedLockupPrimeLock(input: LockupPrimeLockInput): BuildTransactionResult;
|
|
195
|
+
/**
|
|
196
|
+
* Build and sign a LockupPrime unlock transaction (static)
|
|
197
|
+
*/
|
|
198
|
+
static buildSignedLockupPrimeUnlock(input: LockupPrimeUnlockInput): BuildTransactionResult;
|
|
199
|
+
/**
|
|
200
|
+
* Build and sign a LockupPrime daily check-in transaction (static)
|
|
201
|
+
*/
|
|
202
|
+
static buildSignedLockupPrimeDailyCheckin(input: LockupPrimeDailyCheckinInput): BuildTransactionResult;
|
|
203
|
+
/**
|
|
204
|
+
* Build and sign a Lockup unlock transaction (static)
|
|
205
|
+
*/
|
|
206
|
+
static buildSignedLockupUnlock(input: LockupUnlockInput): BuildTransactionResult;
|
|
266
207
|
}
|
|
267
208
|
//# sourceMappingURL=transaction-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-builder.d.ts","sourceRoot":"","sources":["../src/transaction-builder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transaction-builder.d.ts","sourceRoot":"","sources":["../src/transaction-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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