tempo.ts 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/CHANGELOG.md +61 -4
- package/README.md +3 -34
- package/dist/server/Handler.d.ts +14 -14
- package/dist/server/Handler.d.ts.map +1 -1
- package/dist/server/Handler.js +16 -17
- package/dist/server/Handler.js.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +51 -51
- package/dist/wagmi/Actions/amm.d.ts.map +1 -1
- package/dist/wagmi/Actions/amm.js +37 -37
- package/dist/wagmi/Actions/amm.js.map +1 -1
- package/dist/wagmi/Actions/dex.d.ts +129 -129
- package/dist/wagmi/Actions/dex.d.ts.map +1 -1
- package/dist/wagmi/Actions/dex.js +73 -73
- package/dist/wagmi/Actions/dex.js.map +1 -1
- package/dist/wagmi/Actions/faucet.d.ts +9 -9
- package/dist/wagmi/Actions/faucet.d.ts.map +1 -1
- package/dist/wagmi/Actions/faucet.js +7 -7
- package/dist/wagmi/Actions/faucet.js.map +1 -1
- package/dist/wagmi/Actions/fee.d.ts +17 -17
- package/dist/wagmi/Actions/fee.d.ts.map +1 -1
- package/dist/wagmi/Actions/fee.js +10 -10
- package/dist/wagmi/Actions/fee.js.map +1 -1
- package/dist/wagmi/Actions/nonce.d.ts +9 -79
- package/dist/wagmi/Actions/nonce.d.ts.map +1 -1
- package/dist/wagmi/Actions/nonce.js +7 -89
- package/dist/wagmi/Actions/nonce.js.map +1 -1
- package/dist/wagmi/Actions/policy.d.ts +69 -70
- package/dist/wagmi/Actions/policy.d.ts.map +1 -1
- package/dist/wagmi/Actions/policy.js +43 -43
- package/dist/wagmi/Actions/policy.js.map +1 -1
- package/dist/wagmi/Actions/reward.d.ts +51 -51
- package/dist/wagmi/Actions/reward.d.ts.map +1 -1
- package/dist/wagmi/Actions/reward.js +31 -31
- package/dist/wagmi/Actions/reward.js.map +1 -1
- package/dist/wagmi/Actions/token.d.ts +238 -238
- package/dist/wagmi/Actions/token.d.ts.map +1 -1
- package/dist/wagmi/Actions/token.js +136 -136
- package/dist/wagmi/Actions/token.js.map +1 -1
- package/dist/wagmi/Connector.d.ts +2 -1
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +83 -22
- package/dist/wagmi/Connector.js.map +1 -1
- package/dist/wagmi/Hooks/nonce.d.ts +1 -52
- package/dist/wagmi/Hooks/nonce.d.ts.map +1 -1
- package/dist/wagmi/Hooks/nonce.js +1 -70
- package/dist/wagmi/Hooks/nonce.js.map +1 -1
- package/dist/wagmi/Hooks/policy.d.ts +0 -1
- package/dist/wagmi/Hooks/policy.d.ts.map +1 -1
- package/dist/wagmi/Hooks/policy.js.map +1 -1
- package/dist/wagmi/KeyManager.d.ts +6 -3
- package/dist/wagmi/KeyManager.d.ts.map +1 -1
- package/dist/wagmi/KeyManager.js +9 -4
- package/dist/wagmi/KeyManager.js.map +1 -1
- package/package.json +2 -12
- package/src/server/Handler.test.ts +2 -2
- package/src/server/Handler.ts +16 -17
- package/src/wagmi/Actions/amm.ts +63 -63
- package/src/wagmi/Actions/dex.test.ts +1 -1
- package/src/wagmi/Actions/dex.ts +153 -153
- package/src/wagmi/Actions/faucet.ts +11 -11
- package/src/wagmi/Actions/fee.ts +20 -20
- package/src/wagmi/Actions/nonce.test.ts +1 -64
- package/src/wagmi/Actions/nonce.ts +10 -142
- package/src/wagmi/Actions/policy.ts +83 -85
- package/src/wagmi/Actions/reward.ts +64 -61
- package/src/wagmi/Actions/token.ts +287 -283
- package/src/wagmi/Connector.ts +105 -31
- package/src/wagmi/Hooks/dex.test.ts +1 -1
- package/src/wagmi/Hooks/fee.test.ts +0 -6
- package/src/wagmi/Hooks/nonce.test.ts +1 -66
- package/src/wagmi/Hooks/nonce.ts +1 -114
- package/src/wagmi/Hooks/policy.ts +0 -2
- package/src/wagmi/KeyManager.ts +18 -5
- package/dist/chains.d.ts +0 -73
- package/dist/chains.d.ts.map +0 -1
- package/dist/chains.js +0 -51
- package/dist/chains.js.map +0 -1
- package/dist/viem/Abis.d.ts +0 -2649
- package/dist/viem/Abis.d.ts.map +0 -1
- package/dist/viem/Abis.js +0 -1677
- package/dist/viem/Abis.js.map +0 -1
- package/dist/viem/Account.d.ts +0 -244
- package/dist/viem/Account.d.ts.map +0 -1
- package/dist/viem/Account.js +0 -382
- package/dist/viem/Account.js.map +0 -1
- package/dist/viem/Actions/account.d.ts +0 -40
- package/dist/viem/Actions/account.d.ts.map +0 -1
- package/dist/viem/Actions/account.js +0 -86
- package/dist/viem/Actions/account.js.map +0 -1
- package/dist/viem/Actions/amm.d.ts +0 -1991
- package/dist/viem/Actions/amm.d.ts.map +0 -1
- package/dist/viem/Actions/amm.js +0 -814
- package/dist/viem/Actions/amm.js.map +0 -1
- package/dist/viem/Actions/dex.d.ts +0 -3900
- package/dist/viem/Actions/dex.d.ts.map +0 -1
- package/dist/viem/Actions/dex.js +0 -1414
- package/dist/viem/Actions/dex.js.map +0 -1
- package/dist/viem/Actions/faucet.d.ts +0 -69
- package/dist/viem/Actions/faucet.d.ts.map +0 -1
- package/dist/viem/Actions/faucet.js +0 -73
- package/dist/viem/Actions/faucet.js.map +0 -1
- package/dist/viem/Actions/fee.d.ts +0 -360
- package/dist/viem/Actions/fee.d.ts.map +0 -1
- package/dist/viem/Actions/fee.js +0 -237
- package/dist/viem/Actions/fee.js.map +0 -1
- package/dist/viem/Actions/index.d.ts +0 -10
- package/dist/viem/Actions/index.d.ts.map +0 -1
- package/dist/viem/Actions/index.js +0 -10
- package/dist/viem/Actions/index.js.map +0 -1
- package/dist/viem/Actions/nonce.d.ts +0 -257
- package/dist/viem/Actions/nonce.d.ts.map +0 -1
- package/dist/viem/Actions/nonce.js +0 -228
- package/dist/viem/Actions/nonce.js.map +0 -1
- package/dist/viem/Actions/policy.d.ts +0 -1680
- package/dist/viem/Actions/policy.d.ts.map +0 -1
- package/dist/viem/Actions/policy.js +0 -875
- package/dist/viem/Actions/policy.js.map +0 -1
- package/dist/viem/Actions/reward.d.ts +0 -2422
- package/dist/viem/Actions/reward.d.ts.map +0 -1
- package/dist/viem/Actions/reward.js +0 -651
- package/dist/viem/Actions/reward.js.map +0 -1
- package/dist/viem/Actions/token.d.ts +0 -16007
- package/dist/viem/Actions/token.d.ts.map +0 -1
- package/dist/viem/Actions/token.js +0 -2936
- package/dist/viem/Actions/token.js.map +0 -1
- package/dist/viem/Addresses.d.ts +0 -9
- package/dist/viem/Addresses.d.ts.map +0 -1
- package/dist/viem/Addresses.js +0 -9
- package/dist/viem/Addresses.js.map +0 -1
- package/dist/viem/Chain.d.ts +0 -451
- package/dist/viem/Chain.d.ts.map +0 -1
- package/dist/viem/Chain.js +0 -96
- package/dist/viem/Chain.js.map +0 -1
- package/dist/viem/Decorator.d.ts +0 -2783
- package/dist/viem/Decorator.d.ts.map +0 -1
- package/dist/viem/Decorator.js +0 -137
- package/dist/viem/Decorator.js.map +0 -1
- package/dist/viem/Formatters.d.ts +0 -10
- package/dist/viem/Formatters.d.ts.map +0 -1
- package/dist/viem/Formatters.js +0 -104
- package/dist/viem/Formatters.js.map +0 -1
- package/dist/viem/P256.d.ts +0 -2
- package/dist/viem/P256.d.ts.map +0 -1
- package/dist/viem/P256.js +0 -2
- package/dist/viem/P256.js.map +0 -1
- package/dist/viem/Secp256k1.d.ts +0 -2
- package/dist/viem/Secp256k1.d.ts.map +0 -1
- package/dist/viem/Secp256k1.js +0 -2
- package/dist/viem/Secp256k1.js.map +0 -1
- package/dist/viem/Storage.d.ts +0 -24
- package/dist/viem/Storage.d.ts.map +0 -1
- package/dist/viem/Storage.js +0 -68
- package/dist/viem/Storage.js.map +0 -1
- package/dist/viem/TokenIds.d.ts +0 -2
- package/dist/viem/TokenIds.d.ts.map +0 -1
- package/dist/viem/TokenIds.js +0 -2
- package/dist/viem/TokenIds.js.map +0 -1
- package/dist/viem/Transaction.d.ts +0 -76
- package/dist/viem/Transaction.d.ts.map +0 -1
- package/dist/viem/Transaction.js +0 -176
- package/dist/viem/Transaction.js.map +0 -1
- package/dist/viem/Transport.d.ts +0 -33
- package/dist/viem/Transport.d.ts.map +0 -1
- package/dist/viem/Transport.js +0 -138
- package/dist/viem/Transport.js.map +0 -1
- package/dist/viem/WebAuthnP256.d.ts +0 -82
- package/dist/viem/WebAuthnP256.d.ts.map +0 -1
- package/dist/viem/WebAuthnP256.js +0 -97
- package/dist/viem/WebAuthnP256.js.map +0 -1
- package/dist/viem/WebCryptoP256.d.ts +0 -2
- package/dist/viem/WebCryptoP256.d.ts.map +0 -1
- package/dist/viem/WebCryptoP256.js +0 -2
- package/dist/viem/WebCryptoP256.js.map +0 -1
- package/dist/viem/index.d.ts +0 -26
- package/dist/viem/index.d.ts.map +0 -1
- package/dist/viem/index.js +0 -17
- package/dist/viem/index.js.map +0 -1
- package/dist/viem/internal/types.d.ts +0 -20
- package/dist/viem/internal/types.d.ts.map +0 -1
- package/dist/viem/internal/types.js +0 -2
- package/dist/viem/internal/types.js.map +0 -1
- package/dist/viem/internal/utils.d.ts +0 -14
- package/dist/viem/internal/utils.d.ts.map +0 -1
- package/dist/viem/internal/utils.js +0 -33
- package/dist/viem/internal/utils.js.map +0 -1
- package/src/chains.ts +0 -54
- package/src/viem/Abis.ts +0 -1688
- package/src/viem/Account.test.ts +0 -444
- package/src/viem/Account.ts +0 -601
- package/src/viem/Actions/account.test.ts +0 -414
- package/src/viem/Actions/account.ts +0 -106
- package/src/viem/Actions/amm.test.ts +0 -381
- package/src/viem/Actions/amm.ts +0 -1227
- package/src/viem/Actions/dex.test.ts +0 -1549
- package/src/viem/Actions/dex.ts +0 -2150
- package/src/viem/Actions/faucet.ts +0 -121
- package/src/viem/Actions/fee.test.ts +0 -259
- package/src/viem/Actions/fee.ts +0 -372
- package/src/viem/Actions/index.ts +0 -9
- package/src/viem/Actions/nonce.test.ts +0 -206
- package/src/viem/Actions/nonce.ts +0 -347
- package/src/viem/Actions/policy.test.ts +0 -534
- package/src/viem/Actions/policy.ts +0 -1335
- package/src/viem/Actions/reward.test.ts +0 -434
- package/src/viem/Actions/reward.ts +0 -944
- package/src/viem/Actions/token.test.ts +0 -3029
- package/src/viem/Actions/token.ts +0 -4458
- package/src/viem/Addresses.ts +0 -9
- package/src/viem/Chain.bench-d.ts +0 -12
- package/src/viem/Chain.test.ts +0 -168
- package/src/viem/Chain.ts +0 -157
- package/src/viem/Decorator.bench-d.ts +0 -11
- package/src/viem/Decorator.test.ts +0 -39
- package/src/viem/Decorator.ts +0 -3179
- package/src/viem/Formatters.ts +0 -164
- package/src/viem/P256.ts +0 -1
- package/src/viem/Secp256k1.ts +0 -1
- package/src/viem/Storage.ts +0 -110
- package/src/viem/TokenIds.ts +0 -1
- package/src/viem/Transaction.ts +0 -382
- package/src/viem/Transport.ts +0 -191
- package/src/viem/WebAuthnP256.ts +0 -146
- package/src/viem/WebCryptoP256.ts +0 -1
- package/src/viem/e2e.test.ts +0 -1602
- package/src/viem/index.ts +0 -30
- package/src/viem/internal/types.ts +0 -69
- package/src/viem/internal/utils.ts +0 -58
- package/src/wagmi/internal/types.ts +0 -16
package/dist/viem/Transaction.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
// TODO: Find opportunities to make this file less duplicated + more simplified with Viem v3.
|
|
2
|
-
import * as Hex from 'ox/Hex';
|
|
3
|
-
import * as Secp256k1 from 'ox/Secp256k1';
|
|
4
|
-
import * as Signature from 'ox/Signature';
|
|
5
|
-
import { SignatureEnvelope, TxEnvelopeTempo as TxTempo, } from 'ox/tempo';
|
|
6
|
-
import { getTransactionType as viem_getTransactionType, parseTransaction as viem_parseTransaction, serializeTransaction as viem_serializeTransaction, } from 'viem';
|
|
7
|
-
export function getType(transaction) {
|
|
8
|
-
if (typeof transaction.calls !== 'undefined' ||
|
|
9
|
-
typeof transaction.feePayer !== 'undefined' ||
|
|
10
|
-
typeof transaction.feeToken !== 'undefined' ||
|
|
11
|
-
typeof transaction.nonceKey !== 'undefined' ||
|
|
12
|
-
typeof transaction.signature !== 'undefined' ||
|
|
13
|
-
typeof transaction.validBefore !== 'undefined' ||
|
|
14
|
-
typeof transaction.validAfter !== 'undefined')
|
|
15
|
-
return 'tempo';
|
|
16
|
-
if (transaction.type)
|
|
17
|
-
return transaction.type;
|
|
18
|
-
return viem_getTransactionType(transaction);
|
|
19
|
-
}
|
|
20
|
-
export function isTempo(transaction) {
|
|
21
|
-
try {
|
|
22
|
-
const type = getType(transaction);
|
|
23
|
-
return type === 'tempo';
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export function deserialize(serializedTransaction) {
|
|
30
|
-
const type = Hex.slice(serializedTransaction, 0, 1);
|
|
31
|
-
if (type === '0x76') {
|
|
32
|
-
const from = Hex.slice(serializedTransaction, -6) === '0xfeefeefeefee'
|
|
33
|
-
? Hex.slice(serializedTransaction, -26, -6)
|
|
34
|
-
: undefined;
|
|
35
|
-
return {
|
|
36
|
-
...deserializeTempo(serializedTransaction),
|
|
37
|
-
from,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return viem_parseTransaction(serializedTransaction);
|
|
41
|
-
}
|
|
42
|
-
export async function serialize(transaction, signature) {
|
|
43
|
-
// If the transaction is not a Tempo transaction, route to Viem serializer.
|
|
44
|
-
if (!isTempo(transaction)) {
|
|
45
|
-
if (signature && 'type' in signature && signature.type !== 'secp256k1')
|
|
46
|
-
throw new Error('Unsupported signature type. Expected `secp256k1` but got `' +
|
|
47
|
-
signature.type +
|
|
48
|
-
'`.');
|
|
49
|
-
if (signature && 'type' in signature) {
|
|
50
|
-
const { r, s, yParity } = signature?.signature;
|
|
51
|
-
return viem_serializeTransaction(transaction, {
|
|
52
|
-
r: Hex.fromNumber(r, { size: 32 }),
|
|
53
|
-
s: Hex.fromNumber(s, { size: 32 }),
|
|
54
|
-
yParity,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return viem_serializeTransaction(transaction, signature);
|
|
58
|
-
}
|
|
59
|
-
const type = getType(transaction);
|
|
60
|
-
if (type === 'tempo')
|
|
61
|
-
return serializeTempo(transaction, signature);
|
|
62
|
-
throw new Error('Unsupported transaction type');
|
|
63
|
-
}
|
|
64
|
-
////////////////////////////////////////////////////////////////////////////////////
|
|
65
|
-
// Internal
|
|
66
|
-
/** @internal */
|
|
67
|
-
function deserializeTempo(serializedTransaction) {
|
|
68
|
-
const { feePayerSignature, nonce, ...tx } = TxTempo.deserialize(serializedTransaction);
|
|
69
|
-
return {
|
|
70
|
-
...tx,
|
|
71
|
-
nonce: Number(nonce ?? 0n),
|
|
72
|
-
feePayerSignature: feePayerSignature
|
|
73
|
-
? {
|
|
74
|
-
r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),
|
|
75
|
-
s: Hex.fromNumber(feePayerSignature.s, { size: 32 }),
|
|
76
|
-
yParity: feePayerSignature.yParity,
|
|
77
|
-
}
|
|
78
|
-
: feePayerSignature,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/** @internal */
|
|
82
|
-
async function serializeTempo(transaction, sig) {
|
|
83
|
-
const signature = (() => {
|
|
84
|
-
if (transaction.signature)
|
|
85
|
-
return transaction.signature;
|
|
86
|
-
if (sig && 'type' in sig)
|
|
87
|
-
return sig;
|
|
88
|
-
if (sig)
|
|
89
|
-
return SignatureEnvelope.from({
|
|
90
|
-
r: BigInt(sig.r),
|
|
91
|
-
s: BigInt(sig.s),
|
|
92
|
-
yParity: Number(sig.yParity),
|
|
93
|
-
});
|
|
94
|
-
return undefined;
|
|
95
|
-
})();
|
|
96
|
-
const { chainId, feePayer, feePayerSignature, nonce, ...rest } = transaction;
|
|
97
|
-
const transaction_ox = {
|
|
98
|
-
...rest,
|
|
99
|
-
calls: rest.calls?.length
|
|
100
|
-
? rest.calls
|
|
101
|
-
: [
|
|
102
|
-
{
|
|
103
|
-
to: rest.to ||
|
|
104
|
-
(!rest.data || rest.data === '0x'
|
|
105
|
-
? '0x0000000000000000000000000000000000000000'
|
|
106
|
-
: undefined),
|
|
107
|
-
value: rest.value,
|
|
108
|
-
data: rest.data,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
chainId: Number(chainId),
|
|
112
|
-
feePayerSignature: feePayerSignature
|
|
113
|
-
? {
|
|
114
|
-
r: BigInt(feePayerSignature.r),
|
|
115
|
-
s: BigInt(feePayerSignature.s),
|
|
116
|
-
yParity: Number(feePayerSignature.yParity),
|
|
117
|
-
}
|
|
118
|
-
: feePayer
|
|
119
|
-
? null
|
|
120
|
-
: undefined,
|
|
121
|
-
type: 'tempo',
|
|
122
|
-
...(nonce ? { nonce: BigInt(nonce) } : {}),
|
|
123
|
-
};
|
|
124
|
-
if (signature && typeof transaction.feePayer === 'object') {
|
|
125
|
-
const tx = TxTempo.from(transaction_ox, {
|
|
126
|
-
signature,
|
|
127
|
-
});
|
|
128
|
-
const sender = (() => {
|
|
129
|
-
if (transaction.from)
|
|
130
|
-
return transaction.from;
|
|
131
|
-
if (signature.type === 'secp256k1')
|
|
132
|
-
return Secp256k1.recoverAddress({
|
|
133
|
-
payload: TxTempo.getSignPayload(tx),
|
|
134
|
-
signature: signature.signature,
|
|
135
|
-
});
|
|
136
|
-
throw new Error('Unable to extract sender from transaction or signature.');
|
|
137
|
-
})();
|
|
138
|
-
const hash = TxTempo.getFeePayerSignPayload(tx, {
|
|
139
|
-
sender,
|
|
140
|
-
});
|
|
141
|
-
const feePayerSignature = await transaction.feePayer.sign({
|
|
142
|
-
hash,
|
|
143
|
-
});
|
|
144
|
-
return TxTempo.serialize(tx, {
|
|
145
|
-
feePayerSignature: Signature.from(feePayerSignature),
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
if (feePayer === true) {
|
|
149
|
-
const serialized = TxTempo.serialize(transaction_ox, {
|
|
150
|
-
feePayerSignature: null,
|
|
151
|
-
signature,
|
|
152
|
-
});
|
|
153
|
-
// if the transaction is ready to be sent off (signed), add the sender
|
|
154
|
-
// and a fee marker to the serialized transaction, so the fee payer proxy
|
|
155
|
-
// can infer the sender address.
|
|
156
|
-
if (transaction.from && signature)
|
|
157
|
-
return Hex.concat(serialized, transaction.from, '0xfeefeefeefee');
|
|
158
|
-
return serialized;
|
|
159
|
-
}
|
|
160
|
-
return TxTempo.serialize(
|
|
161
|
-
// If we have specified a fee payer, the user will not be signing over the fee token.
|
|
162
|
-
// Defer the fee token signing to the fee payer.
|
|
163
|
-
{ ...transaction_ox, ...(feePayer ? { feeToken: undefined } : {}) }, {
|
|
164
|
-
feePayerSignature: undefined,
|
|
165
|
-
signature,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
// Export types required for inference.
|
|
169
|
-
export {
|
|
170
|
-
/** @deprecated */
|
|
171
|
-
KeyAuthorization as z_KeyAuthorization,
|
|
172
|
-
/** @deprecated */
|
|
173
|
-
SignatureEnvelope as z_SignatureEnvelope,
|
|
174
|
-
/** @deprecated */
|
|
175
|
-
TxEnvelopeTempo as z_TxEnvelopeTempo, } from 'ox/tempo';
|
|
176
|
-
//# sourceMappingURL=Transaction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../src/viem/Transaction.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,SAAS,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAA;AACzC,OAAO,EAIL,iBAAiB,EACjB,eAAe,IAAI,OAAO,GAC3B,MAAM,UAAU,CAAA;AACjB,OAAO,EAUL,kBAAkB,IAAI,uBAAuB,EAC7C,gBAAgB,IAAI,qBAAqB,EAIzC,oBAAoB,IAAI,yBAAyB,GAOlD,MAAM,MAAM,CAAA;AA2Hb,MAAM,UAAU,OAAO,CACrB,WAAoC;IAEpC,IACE,OAAO,WAAW,CAAC,KAAK,KAAK,WAAW;QACxC,OAAO,WAAW,CAAC,QAAQ,KAAK,WAAW;Q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GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,IAAK,CAAC;YACzD,IAAI;SACL,CAAC,CAAA;QAEF,OAAO,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE;YAC3B,iBAAiB,EAAE,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE;YACnD,iBAAiB,EAAE,IAAI;YACvB,SAAS;SACV,CAAC,CAAA;QACF,sEAAsE;QACtE,yEAAyE;QACzE,gCAAgC;QAChC,IAAI,WAAW,CAAC,IAAI,IAAI,SAAS;YAC/B,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;QACnE,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,OAAO,OAAO,CAAC,SAAS;IACtB,qFAAqF;IACrF,gDAAgD;IAChD,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACnE;QACE,iBAAiB,EAAE,SAAS;QAC5B,SAAS;KACV,CACF,CAAA;AACH,CAAC;AAED,uCAAuC;AACvC,OAAO;AACL,kBAAkB;AAClB,gBAAgB,IAAI,kBAAkB;AACtC,kBAAkB;AAClB,iBAAiB,IAAI,mBAAmB;AACxC,kBAAkB;AAClB,eAAe,IAAI,iBAAiB,GACrC,MAAM,UAAU,CAAA"}
|
package/dist/viem/Transport.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type Transport } from 'viem';
|
|
2
|
-
export type FeePayer = Transport<typeof withFeePayer.type>;
|
|
3
|
-
/**
|
|
4
|
-
* Creates a fee payer transport that routes requests between
|
|
5
|
-
* the default transport or the fee payer transport.
|
|
6
|
-
*
|
|
7
|
-
* The policy parameter controls how the fee payer handles transactions:
|
|
8
|
-
* - `'sign-only'`: Fee payer co-signs the transaction and returns it to the client transport, which then broadcasts it via the default transport
|
|
9
|
-
* - `'sign-and-broadcast'`: Fee payer co-signs and broadcasts the transaction directly
|
|
10
|
-
*
|
|
11
|
-
* @param defaultTransport - The default transport to use.
|
|
12
|
-
* @param feePayerTransport - The fee payer transport to use.
|
|
13
|
-
* @param parameters - Configuration parameters.
|
|
14
|
-
* @returns A relay transport.
|
|
15
|
-
*/
|
|
16
|
-
export declare function withFeePayer(defaultTransport: Transport, relayTransport: Transport, parameters?: withFeePayer.Parameters): withFeePayer.ReturnValue;
|
|
17
|
-
export declare namespace withFeePayer {
|
|
18
|
-
const type = "feePayer";
|
|
19
|
-
type Parameters = {
|
|
20
|
-
/** Policy for how the fee payer should handle transactions. Defaults to `'sign-only'`. */
|
|
21
|
-
policy?: 'sign-only' | 'sign-and-broadcast' | undefined;
|
|
22
|
-
};
|
|
23
|
-
type ReturnValue = FeePayer;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Creates a transport that instruments a compatibility layer for
|
|
27
|
-
* `wallet_` RPC actions (`sendCalls`, `getCallsStatus`, etc).
|
|
28
|
-
*
|
|
29
|
-
* @param transport - Transport to wrap.
|
|
30
|
-
* @returns Transport.
|
|
31
|
-
*/
|
|
32
|
-
export declare function walletNamespaceCompat(transport: Transport): Transport;
|
|
33
|
-
//# sourceMappingURL=Transport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../../src/viem/Transport.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,MAAM,CAAA;AASpE,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,gBAAgB,EAAE,SAAS,EAC3B,cAAc,EAAE,SAAS,EACzB,UAAU,CAAC,EAAE,YAAY,CAAC,UAAU,GACnC,YAAY,CAAC,WAAW,CAmD1B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IAC7B,MAAM,IAAI,aAAa,CAAA;IAE9B,KAAY,UAAU,GAAG;QACvB,0FAA0F;QAC1F,MAAM,CAAC,EAAE,WAAW,GAAG,oBAAoB,GAAG,SAAS,CAAA;KACxD,CAAA;IAED,KAAY,WAAW,GAAG,QAAQ,CAAA;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAsFrE"}
|
package/dist/viem/Transport.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import * as Address from 'ox/Address';
|
|
2
|
-
import * as Hash from 'ox/Hash';
|
|
3
|
-
import * as Hex from 'ox/Hex';
|
|
4
|
-
import * as Provider from 'ox/Provider';
|
|
5
|
-
import * as RpcRequest from 'ox/RpcRequest';
|
|
6
|
-
import { createClient, createTransport } from 'viem';
|
|
7
|
-
import { getTransactionReceipt, sendTransaction, sendTransactionSync, } from 'viem/actions';
|
|
8
|
-
import * as Transaction from './Transaction.js';
|
|
9
|
-
/**
|
|
10
|
-
* Creates a fee payer transport that routes requests between
|
|
11
|
-
* the default transport or the fee payer transport.
|
|
12
|
-
*
|
|
13
|
-
* The policy parameter controls how the fee payer handles transactions:
|
|
14
|
-
* - `'sign-only'`: Fee payer co-signs the transaction and returns it to the client transport, which then broadcasts it via the default transport
|
|
15
|
-
* - `'sign-and-broadcast'`: Fee payer co-signs and broadcasts the transaction directly
|
|
16
|
-
*
|
|
17
|
-
* @param defaultTransport - The default transport to use.
|
|
18
|
-
* @param feePayerTransport - The fee payer transport to use.
|
|
19
|
-
* @param parameters - Configuration parameters.
|
|
20
|
-
* @returns A relay transport.
|
|
21
|
-
*/
|
|
22
|
-
export function withFeePayer(defaultTransport, relayTransport, parameters) {
|
|
23
|
-
const { policy = 'sign-only' } = parameters ?? {};
|
|
24
|
-
return (config) => {
|
|
25
|
-
const transport_default = defaultTransport(config);
|
|
26
|
-
const transport_relay = relayTransport(config);
|
|
27
|
-
return createTransport({
|
|
28
|
-
key: withFeePayer.type,
|
|
29
|
-
name: 'Relay Proxy',
|
|
30
|
-
async request({ method, params }, options) {
|
|
31
|
-
if (method === 'eth_sendRawTransactionSync' ||
|
|
32
|
-
method === 'eth_sendRawTransaction') {
|
|
33
|
-
const serialized = params[0];
|
|
34
|
-
const transaction = Transaction.deserialize(serialized);
|
|
35
|
-
// If the transaction is intended to be sponsored, forward it to the relay.
|
|
36
|
-
if (transaction.feePayerSignature === null) {
|
|
37
|
-
// For 'sign-and-broadcast', relay signs and broadcasts
|
|
38
|
-
if (policy === 'sign-and-broadcast')
|
|
39
|
-
return transport_relay.request({ method, params }, options);
|
|
40
|
-
// For 'sign-only', request signature from relay using eth_signRawTransaction
|
|
41
|
-
{
|
|
42
|
-
// Request signature from relay using eth_signRawTransaction
|
|
43
|
-
const signedTransaction = await transport_relay.request({
|
|
44
|
-
method: 'eth_signRawTransaction',
|
|
45
|
-
params: [serialized],
|
|
46
|
-
}, options);
|
|
47
|
-
// Broadcast the signed transaction via the default transport
|
|
48
|
-
return transport_default.request({ method, params: [signedTransaction] }, options);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return transport_default.request({ method, params }, options);
|
|
53
|
-
},
|
|
54
|
-
type: withFeePayer.type,
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Creates a transport that instruments a compatibility layer for
|
|
60
|
-
* `wallet_` RPC actions (`sendCalls`, `getCallsStatus`, etc).
|
|
61
|
-
*
|
|
62
|
-
* @param transport - Transport to wrap.
|
|
63
|
-
* @returns Transport.
|
|
64
|
-
*/
|
|
65
|
-
export function walletNamespaceCompat(transport) {
|
|
66
|
-
const sendCallsMagic = Hash.keccak256(Hex.fromString('TEMPO_5792'));
|
|
67
|
-
return (options) => {
|
|
68
|
-
const t = transport(options);
|
|
69
|
-
const account = options.account;
|
|
70
|
-
const chain = options.chain;
|
|
71
|
-
return {
|
|
72
|
-
...t,
|
|
73
|
-
async request(args) {
|
|
74
|
-
const request = RpcRequest.from(args);
|
|
75
|
-
const client = createClient({
|
|
76
|
-
account,
|
|
77
|
-
chain,
|
|
78
|
-
transport,
|
|
79
|
-
});
|
|
80
|
-
if (request.method === 'wallet_sendCalls') {
|
|
81
|
-
const params = request.params[0] ?? {};
|
|
82
|
-
const { capabilities, chainId, from } = params;
|
|
83
|
-
const { sync } = capabilities ?? {};
|
|
84
|
-
if (!account)
|
|
85
|
-
throw new Provider.DisconnectedError();
|
|
86
|
-
if (!chainId)
|
|
87
|
-
throw new Provider.UnsupportedChainIdError();
|
|
88
|
-
if (Number(chainId) !== client.chain.id)
|
|
89
|
-
throw new Provider.UnsupportedChainIdError();
|
|
90
|
-
if (from && !Address.isEqual(from, account.address))
|
|
91
|
-
throw new Provider.DisconnectedError();
|
|
92
|
-
const calls = (params.calls ?? []).map((call) => ({
|
|
93
|
-
to: call.to,
|
|
94
|
-
value: call.value ? BigInt(call.value) : undefined,
|
|
95
|
-
data: call.data,
|
|
96
|
-
}));
|
|
97
|
-
const hash = await (async () => {
|
|
98
|
-
if (!sync)
|
|
99
|
-
return sendTransaction(client, {
|
|
100
|
-
account,
|
|
101
|
-
calls,
|
|
102
|
-
});
|
|
103
|
-
const { transactionHash } = await sendTransactionSync(client, {
|
|
104
|
-
account,
|
|
105
|
-
calls,
|
|
106
|
-
});
|
|
107
|
-
return transactionHash;
|
|
108
|
-
})();
|
|
109
|
-
const id = Hex.concat(hash, Hex.padLeft(chainId, 32), sendCallsMagic);
|
|
110
|
-
return {
|
|
111
|
-
capabilities: { sync },
|
|
112
|
-
id,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (request.method === 'wallet_getCallsStatus') {
|
|
116
|
-
const [id] = request.params ?? [];
|
|
117
|
-
if (!id)
|
|
118
|
-
throw new Error('`id` not found');
|
|
119
|
-
if (!id.endsWith(sendCallsMagic.slice(2)))
|
|
120
|
-
throw new Error('`id` not supported');
|
|
121
|
-
Hex.assert(id);
|
|
122
|
-
const hash = Hex.slice(id, 0, 32);
|
|
123
|
-
const chainId = Hex.slice(id, 32, 64);
|
|
124
|
-
const receipt = await getTransactionReceipt(client, { hash });
|
|
125
|
-
return {
|
|
126
|
-
atomic: true,
|
|
127
|
-
chainId: Number(chainId),
|
|
128
|
-
receipts: [receipt],
|
|
129
|
-
status: receipt.status === 'success' ? 200 : 500,
|
|
130
|
-
version: '2.0.0',
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
return t.request(args);
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
//# sourceMappingURL=Transport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transport.js","sourceRoot":"","sources":["../../src/viem/Transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,MAAM,CAAA;AACpE,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAI/C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAC1B,gBAA2B,EAC3B,cAAyB,EACzB,UAAoC;IAEpC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,UAAU,IAAI,EA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AQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBACvC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;oBACvC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;oBAEd,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;oBACjC,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;oBAErC,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;oBAC7D,OAAO;wBACL,MAAM,EAAE,IAAI;wBACZ,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;wBACxB,QAAQ,EAAE,CAAC,OAAO,CAAC;wBACnB,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;wBAChD,OAAO,EAAE,OAAO;qBACjB,CAAA;gBACH,CAAC;gBAED,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YACxB,CAAC;SACO,CAAA;IACZ,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as Bytes from 'ox/Bytes';
|
|
2
|
-
import type * as Hex from 'ox/Hex';
|
|
3
|
-
import * as WebAuthnP256 from 'ox/WebAuthnP256';
|
|
4
|
-
export type P256Credential = {
|
|
5
|
-
id: WebAuthnP256.P256Credential['id'];
|
|
6
|
-
publicKey: Hex.Hex;
|
|
7
|
-
raw: WebAuthnP256.P256Credential['raw'];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Creates a WebAuthn credential (ie. a passkey).
|
|
11
|
-
*
|
|
12
|
-
* This function returns the credential object, which includes the public key.
|
|
13
|
-
* It is recommended to store the public key against the credential in an external store
|
|
14
|
-
* as it is not possible to extract a public key from a credential after it has been created.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* import { WebAuthnP256 } from 'tempo.ts/viem'
|
|
19
|
-
*
|
|
20
|
-
* const credential = await WebAuthnP256.createCredential({ name: 'Example' })
|
|
21
|
-
* // {
|
|
22
|
-
* // id: 'oZ48...',
|
|
23
|
-
* // publicKey: '0x...',
|
|
24
|
-
* // }
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @param parameters WebAuthnP256 createCredential options.
|
|
28
|
-
* @returns WebAuthn credential.
|
|
29
|
-
*/
|
|
30
|
-
export declare function createCredential(parameters: createCredential.Parameters): Promise<createCredential.ReturnValue>;
|
|
31
|
-
export declare namespace createCredential {
|
|
32
|
-
type Parameters = Omit<WebAuthnP256.createCredential.Options, 'rp' | 'user'> & {
|
|
33
|
-
/**
|
|
34
|
-
* Credential creation function. Useful for environments that do not support
|
|
35
|
-
* the WebAuthn API natively (i.e. React Native or testing environments).
|
|
36
|
-
*
|
|
37
|
-
* @default window.navigator.credentials.create
|
|
38
|
-
*/
|
|
39
|
-
createFn?: WebAuthnP256.createCredential.Options['createFn'] | undefined;
|
|
40
|
-
/** Label. */
|
|
41
|
-
label: string;
|
|
42
|
-
/** Relying Party ID. */
|
|
43
|
-
rpId?: string | undefined;
|
|
44
|
-
/** User ID. */
|
|
45
|
-
userId?: Bytes.Bytes | undefined;
|
|
46
|
-
};
|
|
47
|
-
type ReturnValue = P256Credential;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Gets a WebAuthn credential (ie. a passkey), and optionally signs over a digest/hash.
|
|
51
|
-
*
|
|
52
|
-
* A `getPublicKey` function is required to fetch the public key paired with the credential
|
|
53
|
-
* from an external store. It is not possible to extract a public key from a credential after
|
|
54
|
-
* the credential has been created with `WebAuthnP256.createCredential`.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* import { WebAuthnP256 } from 'tempo.ts/viem'
|
|
59
|
-
*
|
|
60
|
-
* const credential = await WebAuthnP256.getCredential({
|
|
61
|
-
* async getPublicKey(credential) {
|
|
62
|
-
* // Get public key from store
|
|
63
|
-
* return store.getPublicKey(credential.id)
|
|
64
|
-
* }
|
|
65
|
-
* })
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* @param parameters WebAuthnP256 getCredential options.
|
|
69
|
-
* @returns WebAuthn credential.
|
|
70
|
-
*/
|
|
71
|
-
export declare function getCredential(parameters: getCredential.Parameters): Promise<getCredential.ReturnValue>;
|
|
72
|
-
export declare namespace getCredential {
|
|
73
|
-
type Parameters = Omit<WebAuthnP256.sign.Options, 'challenge'> & {
|
|
74
|
-
hash?: Hex.Hex | undefined;
|
|
75
|
-
getPublicKey: (credential: WebAuthnP256.P256Credential['raw']) => Promise<Hex.Hex>;
|
|
76
|
-
};
|
|
77
|
-
type ReturnValue = WebAuthnP256.sign.ReturnType & {
|
|
78
|
-
id: string;
|
|
79
|
-
publicKey: Hex.Hex;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=WebAuthnP256.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebAuthnP256.d.ts","sourceRoot":"","sources":["../../src/viem/WebAuthnP256.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,KAAK,KAAK,GAAG,MAAM,QAAQ,CAAA;AAElC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IACrC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAA;IAClB,GAAG,EAAE,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;CACxC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;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@
|
|
|
1
|
-
import * as Bytes from 'ox/Bytes';
|
|
2
|
-
import * as PublicKey from 'ox/PublicKey';
|
|
3
|
-
import * as WebAuthnP256 from 'ox/WebAuthnP256';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a WebAuthn credential (ie. a passkey).
|
|
6
|
-
*
|
|
7
|
-
* This function returns the credential object, which includes the public key.
|
|
8
|
-
* It is recommended to store the public key against the credential in an external store
|
|
9
|
-
* as it is not possible to extract a public key from a credential after it has been created.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { WebAuthnP256 } from 'tempo.ts/viem'
|
|
14
|
-
*
|
|
15
|
-
* const credential = await WebAuthnP256.createCredential({ name: 'Example' })
|
|
16
|
-
* // {
|
|
17
|
-
* // id: 'oZ48...',
|
|
18
|
-
* // publicKey: '0x...',
|
|
19
|
-
* // }
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @param parameters WebAuthnP256 createCredential options.
|
|
23
|
-
* @returns WebAuthn credential.
|
|
24
|
-
*/
|
|
25
|
-
export async function createCredential(parameters) {
|
|
26
|
-
const { createFn, label, rpId, userId } = parameters;
|
|
27
|
-
const credential = await WebAuthnP256.createCredential({
|
|
28
|
-
...parameters,
|
|
29
|
-
authenticatorSelection: {
|
|
30
|
-
...parameters.authenticatorSelection,
|
|
31
|
-
requireResidentKey: true,
|
|
32
|
-
residentKey: 'required',
|
|
33
|
-
userVerification: 'required',
|
|
34
|
-
},
|
|
35
|
-
createFn,
|
|
36
|
-
extensions: {
|
|
37
|
-
...parameters.extensions,
|
|
38
|
-
credProps: true,
|
|
39
|
-
},
|
|
40
|
-
rp: rpId
|
|
41
|
-
? {
|
|
42
|
-
id: rpId,
|
|
43
|
-
name: rpId,
|
|
44
|
-
}
|
|
45
|
-
: undefined,
|
|
46
|
-
name: undefined,
|
|
47
|
-
user: {
|
|
48
|
-
displayName: label,
|
|
49
|
-
id: new Uint8Array(userId ?? Bytes.fromString(label)),
|
|
50
|
-
name: label,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
id: credential.id,
|
|
55
|
-
publicKey: PublicKey.toHex(credential.publicKey, {
|
|
56
|
-
includePrefix: false,
|
|
57
|
-
}),
|
|
58
|
-
raw: credential.raw,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Gets a WebAuthn credential (ie. a passkey), and optionally signs over a digest/hash.
|
|
63
|
-
*
|
|
64
|
-
* A `getPublicKey` function is required to fetch the public key paired with the credential
|
|
65
|
-
* from an external store. It is not possible to extract a public key from a credential after
|
|
66
|
-
* the credential has been created with `WebAuthnP256.createCredential`.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* import { WebAuthnP256 } from 'tempo.ts/viem'
|
|
71
|
-
*
|
|
72
|
-
* const credential = await WebAuthnP256.getCredential({
|
|
73
|
-
* async getPublicKey(credential) {
|
|
74
|
-
* // Get public key from store
|
|
75
|
-
* return store.getPublicKey(credential.id)
|
|
76
|
-
* }
|
|
77
|
-
* })
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* @param parameters WebAuthnP256 getCredential options.
|
|
81
|
-
* @returns WebAuthn credential.
|
|
82
|
-
*/
|
|
83
|
-
export async function getCredential(parameters) {
|
|
84
|
-
const { metadata, raw, signature } = await WebAuthnP256.sign({
|
|
85
|
-
...parameters,
|
|
86
|
-
challenge: parameters.hash ?? '0x',
|
|
87
|
-
});
|
|
88
|
-
const publicKey = await parameters.getPublicKey(raw);
|
|
89
|
-
return {
|
|
90
|
-
id: raw.id,
|
|
91
|
-
metadata,
|
|
92
|
-
publicKey,
|
|
93
|
-
raw,
|
|
94
|
-
signature,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=WebAuthnP256.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebAuthnP256.js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,CAAC,KAAK,UAAU,aAAa,CACjC,UAAoC;IAEpC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC;QAC3D,GAAG,UAAU;QACb,SAAS,EAAE,UAAU,CAAC,IAAI,IAAI,IAAI;KACnC,CAAC,CAAA;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACpD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,QAAQ;QACR,SAAS;QACT,GAAG;QACH,SAAS;KACV,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebCryptoP256.d.ts","sourceRoot":"","sources":["../../src/viem/WebCryptoP256.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebCryptoP256.js","sourceRoot":"","sources":["../../src/viem/WebCryptoP256.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/viem/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
KeyAuthorization as z_KeyAuthorization,
|
|
4
|
-
/** @deprecated */
|
|
5
|
-
SignatureEnvelope as z_SignatureEnvelope,
|
|
6
|
-
/** @deprecated */
|
|
7
|
-
TokenId as z_TokenId,
|
|
8
|
-
/** @deprecated */
|
|
9
|
-
TxEnvelopeTempo as z_TxEnvelopeTempo, } from 'ox/tempo';
|
|
10
|
-
export { Tick } from 'ox/tempo';
|
|
11
|
-
export * as Abis from './Abis.js';
|
|
12
|
-
export * as Account from './Account.js';
|
|
13
|
-
export * as Actions from './Actions/index.js';
|
|
14
|
-
export * as Addresses from './Addresses.js';
|
|
15
|
-
export * as Chain from './Chain.js';
|
|
16
|
-
export { type Decorator as TempoActions, decorator as tempoActions, } from './Decorator.js';
|
|
17
|
-
export * as Formatters from './Formatters.js';
|
|
18
|
-
export * as P256 from './P256.js';
|
|
19
|
-
export * as Secp256k1 from './Secp256k1.js';
|
|
20
|
-
export * as TokenIds from './TokenIds.js';
|
|
21
|
-
export * as Transaction from './Transaction.js';
|
|
22
|
-
export * as Transport from './Transport.js';
|
|
23
|
-
export { withFeePayer } from './Transport.js';
|
|
24
|
-
export * as WebAuthnP256 from './WebAuthnP256.js';
|
|
25
|
-
export * as WebCryptoP256 from './WebCryptoP256.js';
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/viem/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/viem/index.ts"],"names":[],"mappings":"AACA,YAAY;AACV,kBAAkB;AAClB,gBAAgB,IAAI,kBAAkB;AACtC,kBAAkB;AAClB,iBAAiB,IAAI,mBAAmB;AACxC,kBAAkB;AAClB,OAAO,IAAI,SAAS;AACpB,kBAAkB;AAClB,eAAe,IAAI,iBAAiB,GACrC,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,EACL,KAAK,SAAS,IAAI,YAAY,EAC9B,SAAS,IAAI,YAAY,GAC1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA"}
|
package/dist/viem/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export { Tick } from 'ox/tempo';
|
|
2
|
-
export * as Abis from './Abis.js';
|
|
3
|
-
export * as Account from './Account.js';
|
|
4
|
-
export * as Actions from './Actions/index.js';
|
|
5
|
-
export * as Addresses from './Addresses.js';
|
|
6
|
-
export * as Chain from './Chain.js';
|
|
7
|
-
export { decorator as tempoActions, } from './Decorator.js';
|
|
8
|
-
export * as Formatters from './Formatters.js';
|
|
9
|
-
export * as P256 from './P256.js';
|
|
10
|
-
export * as Secp256k1 from './Secp256k1.js';
|
|
11
|
-
export * as TokenIds from './TokenIds.js';
|
|
12
|
-
export * as Transaction from './Transaction.js';
|
|
13
|
-
export * as Transport from './Transport.js';
|
|
14
|
-
export { withFeePayer } from './Transport.js';
|
|
15
|
-
export * as WebAuthnP256 from './WebAuthnP256.js';
|
|
16
|
-
export * as WebCryptoP256 from './WebCryptoP256.js';
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
package/dist/viem/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/viem/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,EAEL,SAAS,IAAI,YAAY,GAC1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA"}
|