ox 0.14.61 → 0.14.63
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/CHANGELOG.md +16 -0
- package/_cjs/core/AbiEvent.js +14 -8
- package/_cjs/core/AbiEvent.js.map +1 -1
- package/_cjs/core/AbiItem.js +8 -1
- package/_cjs/core/AbiItem.js.map +1 -1
- package/_cjs/core/Caches.js +3 -6
- package/_cjs/core/Caches.js.map +1 -1
- package/_cjs/core/Hex.js +2 -1
- package/_cjs/core/Hex.js.map +1 -1
- package/_cjs/core/Siwe.js +10 -5
- package/_cjs/core/Siwe.js.map +1 -1
- package/_cjs/core/TypedData.js +7 -4
- package/_cjs/core/TypedData.js.map +1 -1
- package/_cjs/core/Value.js +5 -3
- package/_cjs/core/Value.js.map +1 -1
- package/_cjs/core/internal/abiItem.js +6 -3
- package/_cjs/core/internal/abiItem.js.map +1 -1
- package/_cjs/core/internal/caches.js +9 -0
- package/_cjs/core/internal/caches.js.map +1 -0
- package/_cjs/core/internal/frameNonce.js +2 -2
- package/_cjs/core/internal/frameNonce.js.map +1 -1
- package/_cjs/tempo/AccountOperation.js +26 -6
- package/_cjs/tempo/AccountOperation.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/core/AbiEvent.js +18 -8
- package/_esm/core/AbiEvent.js.map +1 -1
- package/_esm/core/AbiItem.js +10 -1
- package/_esm/core/AbiItem.js.map +1 -1
- package/_esm/core/Caches.js +1 -4
- package/_esm/core/Caches.js.map +1 -1
- package/_esm/core/Hex.js +2 -1
- package/_esm/core/Hex.js.map +1 -1
- package/_esm/core/Siwe.js +11 -5
- package/_esm/core/Siwe.js.map +1 -1
- package/_esm/core/TypedData.js +7 -4
- package/_esm/core/TypedData.js.map +1 -1
- package/_esm/core/Value.js +5 -3
- package/_esm/core/Value.js.map +1 -1
- package/_esm/core/internal/abiItem.js +18 -7
- package/_esm/core/internal/abiItem.js.map +1 -1
- package/_esm/core/internal/caches.js +10 -0
- package/_esm/core/internal/caches.js.map +1 -0
- package/_esm/core/internal/frameNonce.js +2 -2
- package/_esm/core/internal/frameNonce.js.map +1 -1
- package/_esm/tempo/AccountOperation.js +26 -6
- package/_esm/tempo/AccountOperation.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/core/AbiEvent.d.ts +2 -4
- package/_types/core/AbiEvent.d.ts.map +1 -1
- package/_types/core/AbiItem.d.ts.map +1 -1
- package/_types/core/Caches.d.ts +1 -2
- package/_types/core/Caches.d.ts.map +1 -1
- package/_types/core/Hex.d.ts.map +1 -1
- package/_types/core/Siwe.d.ts.map +1 -1
- package/_types/core/TypedData.d.ts.map +1 -1
- package/_types/core/Value.d.ts.map +1 -1
- package/_types/core/internal/abiItem.d.ts.map +1 -1
- package/_types/core/internal/caches.d.ts +10 -0
- package/_types/core/internal/caches.d.ts.map +1 -0
- package/_types/core/internal/frameNonce.d.ts.map +1 -1
- package/_types/tempo/AccountOperation.d.ts +8 -0
- package/_types/tempo/AccountOperation.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/core/AbiEvent.ts +22 -11
- package/core/AbiItem.ts +9 -1
- package/core/Caches.ts +1 -6
- package/core/Hex.ts +3 -1
- package/core/Siwe.ts +13 -7
- package/core/TypedData.ts +8 -4
- package/core/Value.ts +6 -3
- package/core/internal/abiItem.ts +21 -14
- package/core/internal/caches.ts +12 -0
- package/core/internal/frameNonce.ts +3 -4
- package/package.json +1 -1
- package/tempo/AccountOperation.test.ts +116 -0
- package/tempo/AccountOperation.ts +38 -5
- package/version.ts +1 -1
|
@@ -43,6 +43,12 @@ export type TransactionOperation<quantity = bigint> = Base<quantity> & {
|
|
|
43
43
|
transactionHash?: Hex.Hex | undefined
|
|
44
44
|
/** Operation kind. */
|
|
45
45
|
type: 'transaction'
|
|
46
|
+
/**
|
|
47
|
+
* Parent account when the configurable account signs as its access key
|
|
48
|
+
* (TIP-1111). The transaction is then sent from it with a keychain V2
|
|
49
|
+
* signature wrapping the owner quorum.
|
|
50
|
+
*/
|
|
51
|
+
userAddress?: Address.Address | undefined
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
/** Account key authorization approval operation. */
|
|
@@ -96,6 +102,7 @@ export function getHash(options: getHash.Options): Hex.Hex {
|
|
|
96
102
|
TxEnvelopeTempo.deserialize(
|
|
97
103
|
options.transaction as TxEnvelopeTempo.Serialized,
|
|
98
104
|
),
|
|
105
|
+
{ from: options.userAddress },
|
|
99
106
|
)
|
|
100
107
|
: KeyAuthorization_.getSignPayload(
|
|
101
108
|
KeyAuthorization_.deserialize(options.keyAuthorization),
|
|
@@ -126,6 +133,8 @@ export declare namespace getHash {
|
|
|
126
133
|
transaction: Hex.Hex
|
|
127
134
|
/** Operation kind. */
|
|
128
135
|
type: 'transaction'
|
|
136
|
+
/** Parent account when the configurable account signs as its access key. */
|
|
137
|
+
userAddress?: Address.Address | undefined
|
|
129
138
|
}
|
|
130
139
|
)
|
|
131
140
|
|
|
@@ -331,17 +340,26 @@ export function serializeTransaction(
|
|
|
331
340
|
assertApproval(value.account, approval, value.config),
|
|
332
341
|
)
|
|
333
342
|
assertRetainedApprovals(value, approvals)
|
|
343
|
+
const { userAddress } = value
|
|
334
344
|
const signatures = SignatureEnvelope.sortApprovals({
|
|
335
345
|
account: value.account,
|
|
336
346
|
config: value.config,
|
|
337
|
-
payload: TxEnvelopeTempo.getSignPayload(envelope),
|
|
347
|
+
payload: TxEnvelopeTempo.getSignPayload(envelope, { from: userAddress }),
|
|
338
348
|
signatures: approvals,
|
|
339
349
|
})
|
|
340
|
-
const
|
|
350
|
+
const configurable = SignatureEnvelope.from({
|
|
341
351
|
account: value.account,
|
|
342
352
|
config: value.config,
|
|
343
353
|
signatures,
|
|
344
354
|
})
|
|
355
|
+
const signature = userAddress
|
|
356
|
+
? SignatureEnvelope.from({
|
|
357
|
+
inner: configurable,
|
|
358
|
+
type: 'keychain',
|
|
359
|
+
userAddress,
|
|
360
|
+
version: 'v2',
|
|
361
|
+
})
|
|
362
|
+
: configurable
|
|
345
363
|
return TxEnvelopeTempo.serialize(
|
|
346
364
|
envelope,
|
|
347
365
|
value.transaction.startsWith(TxEnvelopeTempo.feePayerMagic)
|
|
@@ -803,14 +821,27 @@ function assertTransaction(operation: TransactionOperation): void {
|
|
|
803
821
|
throw new InvalidOperationError({
|
|
804
822
|
reason: 'transaction must not contain an outer sender signature',
|
|
805
823
|
})
|
|
824
|
+
const { userAddress } = operation
|
|
825
|
+
if (userAddress !== undefined) {
|
|
826
|
+
if (!Address.validate(userAddress) || Hex.toBigInt(userAddress) === 0n)
|
|
827
|
+
throw new InvalidOperationError({ reason: 'userAddress is invalid' })
|
|
828
|
+
if (userAddress.toLowerCase() === operation.account.toLowerCase())
|
|
829
|
+
throw new InvalidOperationError({
|
|
830
|
+
reason: 'a configurable account cannot be its own access key',
|
|
831
|
+
})
|
|
832
|
+
}
|
|
833
|
+
const sender = userAddress ?? operation.account
|
|
806
834
|
if (
|
|
807
835
|
transaction.from &&
|
|
808
|
-
transaction.from.toLowerCase() !==
|
|
836
|
+
transaction.from.toLowerCase() !== sender.toLowerCase()
|
|
809
837
|
)
|
|
810
838
|
throw new InvalidOperationError({
|
|
811
839
|
reason: 'transaction sender does not match the operation account',
|
|
812
840
|
})
|
|
813
|
-
assertOperationHash(
|
|
841
|
+
assertOperationHash(
|
|
842
|
+
operation,
|
|
843
|
+
TxEnvelopeTempo.getSignPayload(transaction, { from: userAddress }),
|
|
844
|
+
)
|
|
814
845
|
const feePayer = operation.transaction.startsWith(
|
|
815
846
|
TxEnvelopeTempo.feePayerMagic,
|
|
816
847
|
)
|
|
@@ -842,12 +873,14 @@ function assertKeyAuthorization(
|
|
|
842
873
|
submissionId?: unknown
|
|
843
874
|
transaction?: unknown
|
|
844
875
|
transactionHash?: unknown
|
|
876
|
+
userAddress?: unknown
|
|
845
877
|
}
|
|
846
878
|
if (
|
|
847
879
|
transactionFields.expiresAt !== undefined ||
|
|
848
880
|
transactionFields.submissionId !== undefined ||
|
|
849
881
|
transactionFields.transaction !== undefined ||
|
|
850
|
-
transactionFields.transactionHash !== undefined
|
|
882
|
+
transactionFields.transactionHash !== undefined ||
|
|
883
|
+
transactionFields.userAddress !== undefined
|
|
851
884
|
)
|
|
852
885
|
throw new InvalidOperationError({
|
|
853
886
|
reason: 'key authorization operations cannot contain transaction fields',
|
package/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal */
|
|
2
|
-
export const version = '0.14.
|
|
2
|
+
export const version = '0.14.63'
|