Skip to content

Commit 5165cd1

Browse files
jxomampcode-com
andcommitted
docs(tempo): use bech32m addresses in JSDoc examples
Update all user-facing input addresses in JSDoc @example blocks to use Tempo bech32m format (tempo1...) instead of raw hex. Output/log lines, RPC format examples, RLP tuples, and signature data remain as hex. Amp-Thread-ID: https://ampcode.com/threads/T-019cbba1-87d6-75f0-a887-8361637420ab Co-authored-by: Amp <amp@ampcode.com>
1 parent bae90c8 commit 5165cd1

File tree

6 files changed

+55
-55
lines changed

6 files changed

+55
-55
lines changed

src/tempo/AuthorizationTempo.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export type TupleListSigned = TupleList<true>
101101
* import { AuthorizationTempo } from 'ox/tempo'
102102
*
103103
* const authorization = AuthorizationTempo.from({
104-
* address: '0x1234567890abcdef1234567890abcdef12345678',
104+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
105105
* chainId: 1,
106106
* nonce: 69n,
107107
* })
@@ -119,7 +119,7 @@ export type TupleListSigned = TupleList<true>
119119
* const privateKey = Secp256k1.randomPrivateKey()
120120
*
121121
* const authorization = AuthorizationTempo.from({
122-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
122+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
123123
* chainId: 1,
124124
* nonce: 40n,
125125
* })
@@ -149,7 +149,7 @@ export type TupleListSigned = TupleList<true>
149149
* const { privateKey, publicKey } = P256.createKeyPair()
150150
*
151151
* const authorization = AuthorizationTempo.from({
152-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
152+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
153153
* chainId: 1,
154154
* nonce: 40n,
155155
* })
@@ -184,7 +184,7 @@ export type TupleListSigned = TupleList<true>
184184
* const { privateKey, publicKey } = await WebCryptoP256.createKeyPair()
185185
*
186186
* const authorization = AuthorizationTempo.from({
187-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
187+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
188188
* chainId: 1,
189189
* nonce: 40n,
190190
* })
@@ -220,7 +220,7 @@ export type TupleListSigned = TupleList<true>
220220
* const credential = await WebAuthnP256.createCredential({ name: 'Example' })
221221
*
222222
* const authorization = AuthorizationTempo.from({
223-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
223+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
224224
* chainId: 1,
225225
* nonce: 40n,
226226
* })
@@ -302,7 +302,7 @@ export declare namespace from {
302302
* import { AuthorizationTempo } from 'ox/tempo'
303303
*
304304
* const authorization = AuthorizationTempo.fromRpc({
305-
* address: '0x0000000000000000000000000000000000000000',
305+
* address: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
306306
* chainId: '0x1',
307307
* nonce: '0x1',
308308
* signature: {
@@ -340,7 +340,7 @@ export declare namespace fromRpc {
340340
* import { AuthorizationTempo } from 'ox/tempo'
341341
*
342342
* const authorizationList = AuthorizationTempo.fromRpcList([{
343-
* address: '0x0000000000000000000000000000000000000000',
343+
* address: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
344344
* chainId: '0x1',
345345
* nonce: '0x1',
346346
* signature: {
@@ -524,7 +524,7 @@ export declare namespace fromTupleList {
524524
* const privateKey = Secp256k1.randomPrivateKey()
525525
*
526526
* const authorization = AuthorizationTempo.from({
527-
* address: '0x1234567890abcdef1234567890abcdef12345678',
527+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
528528
* chainId: 1,
529529
* nonce: 69n,
530530
* })
@@ -552,7 +552,7 @@ export declare namespace fromTupleList {
552552
* const { privateKey, publicKey } = P256.createKeyPair()
553553
*
554554
* const authorization = AuthorizationTempo.from({
555-
* address: '0x1234567890abcdef1234567890abcdef12345678',
555+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
556556
* chainId: 1,
557557
* nonce: 69n,
558558
* })
@@ -585,7 +585,7 @@ export declare namespace fromTupleList {
585585
* const { privateKey, publicKey } = await WebCryptoP256.createKeyPair()
586586
*
587587
* const authorization = AuthorizationTempo.from({
588-
* address: '0x1234567890abcdef1234567890abcdef12345678',
588+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
589589
* chainId: 1,
590590
* nonce: 69n,
591591
* })
@@ -619,7 +619,7 @@ export declare namespace fromTupleList {
619619
* const credential = await WebAuthnP256.createCredential({ name: 'Example' })
620620
*
621621
* const authorization = AuthorizationTempo.from({
622-
* address: '0x1234567890abcdef1234567890abcdef12345678',
622+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
623623
* chainId: 1,
624624
* nonce: 69n,
625625
* })
@@ -660,7 +660,7 @@ export declare namespace getSignPayload {
660660
* import { AuthorizationTempo } from 'ox/tempo'
661661
*
662662
* const authorization = AuthorizationTempo.from({
663-
* address: '0x1234567890abcdef1234567890abcdef12345678',
663+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
664664
* chainId: 1,
665665
* nonce: 69n,
666666
* })
@@ -716,7 +716,7 @@ export declare namespace hash {
716716
* import { AuthorizationTempo } from 'ox/tempo'
717717
*
718718
* const authorization = AuthorizationTempo.toRpc({
719-
* address: '0x0000000000000000000000000000000000000000',
719+
* address: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
720720
* chainId: 1,
721721
* nonce: 1n,
722722
* signature: {
@@ -756,7 +756,7 @@ export declare namespace toRpc {
756756
* import { AuthorizationTempo } from 'ox/tempo'
757757
*
758758
* const authorization = AuthorizationTempo.toRpcList([{
759-
* address: '0x0000000000000000000000000000000000000000',
759+
* address: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
760760
* chainId: 1,
761761
* nonce: 1n,
762762
* signature: {
@@ -789,7 +789,7 @@ export declare namespace toRpcList {
789789
* import { AuthorizationTempo } from 'ox/tempo'
790790
*
791791
* const authorization = AuthorizationTempo.from({
792-
* address: '0x1234567890abcdef1234567890abcdef12345678',
792+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
793793
* chainId: 1,
794794
* nonce: 69n,
795795
* })
@@ -838,12 +838,12 @@ export declare namespace toTuple {
838838
* import { AuthorizationTempo } from 'ox/tempo'
839839
*
840840
* const authorization_1 = AuthorizationTempo.from({
841-
* address: '0x1234567890abcdef1234567890abcdef12345678',
841+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
842842
* chainId: 1,
843843
* nonce: 69n,
844844
* })
845845
* const authorization_2 = AuthorizationTempo.from({
846-
* address: '0x1234567890abcdef1234567890abcdef12345678',
846+
* address: 'tempo1qqfrg4ncjz4ummcjx3t83y9tehh3ydzk0qhcg00y',
847847
* chainId: 3,
848848
* nonce: 20n,
849849
* })

src/tempo/KeyAuthorization.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export type TokenLimit<bigintType = bigint> = {
141141
* expiry: 1234567890,
142142
* type: 'secp256k1',
143143
* limits: [{
144-
* token: '0x20c0000000000000000000000000000000000001',
144+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
145145
* limit: Value.from('10', 6),
146146
* }],
147147
* })
@@ -163,7 +163,7 @@ export type TokenLimit<bigintType = bigint> = {
163163
* expiry: 1234567890,
164164
* type: 'p256',
165165
* limits: [{
166-
* token: '0x20c0000000000000000000000000000000000001',
166+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
167167
* limit: Value.from('10', 6),
168168
* }],
169169
* })
@@ -188,7 +188,7 @@ export type TokenLimit<bigintType = bigint> = {
188188
* expiry: 1234567890,
189189
* type: 'secp256k1',
190190
* limits: [{
191-
* token: '0x20c0000000000000000000000000000000000001',
191+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
192192
* limit: Value.from('10', 6),
193193
* }],
194194
* })
@@ -222,7 +222,7 @@ export type TokenLimit<bigintType = bigint> = {
222222
* expiry: 1234567890,
223223
* type: 'p256',
224224
* limits: [{
225-
* token: '0x20c0000000000000000000000000000000000001',
225+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
226226
* limit: Value.from('10', 6),
227227
* }],
228228
* })
@@ -468,7 +468,7 @@ export declare namespace fromTuple {
468468
* expiry: 1234567890,
469469
* type: 'secp256k1',
470470
* limits: [{
471-
* token: '0x20c0000000000000000000000000000000000001',
471+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
472472
* limit: Value.from('10', 6),
473473
* }],
474474
* })
@@ -496,12 +496,12 @@ export declare namespace getSignPayload {
496496
* import { Value } from 'ox'
497497
*
498498
* const authorization = KeyAuthorization.from({
499-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
499+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
500500
* chainId: 4217n,
501501
* expiry: 1234567890,
502502
* type: 'secp256k1',
503503
* limits: [{
504-
* token: '0x20c0000000000000000000000000000000000001',
504+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
505505
* limit: Value.from('10', 6)
506506
* }],
507507
* })
@@ -534,12 +534,12 @@ export declare namespace deserialize {
534534
* import { Value } from 'ox'
535535
*
536536
* const authorization = KeyAuthorization.from({
537-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
537+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
538538
* chainId: 4217n,
539539
* expiry: 1234567890,
540540
* type: 'secp256k1',
541541
* limits: [{
542-
* token: '0x20c0000000000000000000000000000000000001',
542+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
543543
* limit: Value.from('10', 6)
544544
* }],
545545
* })
@@ -574,12 +574,12 @@ export declare namespace hash {
574574
* import { Value } from 'ox'
575575
*
576576
* const authorization = KeyAuthorization.from({
577-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
577+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
578578
* chainId: 4217n,
579579
* expiry: 1234567890,
580580
* type: 'secp256k1',
581581
* limits: [{
582-
* token: '0x20c0000000000000000000000000000000000001',
582+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
583583
* limit: Value.from('10', 6)
584584
* }],
585585
* })
@@ -611,12 +611,12 @@ export declare namespace serialize {
611611
* import { Value } from 'ox'
612612
*
613613
* const authorization = KeyAuthorization.toRpc({
614-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
614+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
615615
* chainId: 4217n,
616616
* expiry: 1234567890,
617617
* type: 'secp256k1',
618618
* limits: [{
619-
* token: '0x20c0000000000000000000000000000000000001',
619+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
620620
* limit: Value.from('10', 6)
621621
* }],
622622
* signature: {
@@ -662,12 +662,12 @@ export declare namespace toRpc {
662662
* import { Value } from 'ox'
663663
*
664664
* const authorization = KeyAuthorization.from({
665-
* address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
665+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
666666
* chainId: 4217n,
667667
* expiry: 1234567890,
668668
* type: 'secp256k1',
669669
* limits: [{
670-
* token: '0x20c0000000000000000000000000000000000001',
670+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
671671
* limit: Value.from('10', 6)
672672
* }],
673673
* })

src/tempo/TokenId.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function from(tokenIdOrAddress: TokenIdOrAddress | number): TokenId {
4545
* ```ts twoslash
4646
* import { TokenId } from 'ox/tempo'
4747
*
48-
* const tokenId = TokenId.fromAddress('0x20c00000000000000000000000000000000000000001')
48+
* const tokenId = TokenId.fromAddress('tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd')
4949
* ```
5050
*
5151
* @param address - The token address.
@@ -96,7 +96,7 @@ export function toAddress(tokenId: TokenIdOrAddress): Address.Address {
9696
* import { TokenId } from 'ox/tempo'
9797
*
9898
* const id = TokenId.compute({
99-
* sender: '0x1234567890123456789012345678901234567890',
99+
* sender: 'tempo1qqfrg4ncjqfrg4ncjqfrg4ncjqfrg4ncjqgmv79k',
100100
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
101101
* })
102102
* ```

src/tempo/TransactionRequest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export type Rpc = Omit<
6565
* const request = TransactionRequest.toRpc({
6666
* calls: [{
6767
* data: '0xdeadbeef',
68-
* to: '0xcafebabecafebabecafebabecafebabecafebabe',
68+
* to: 'tempo1qr90aw47etlt40k2l6atajh7h2lv4l46hcx5uwlp',
6969
* }],
70-
* feeToken: '0x20c0000000000000000000000000000000000000',
70+
* feeToken: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv0ywuh',
7171
* })
7272
* ```
7373
*
@@ -87,9 +87,9 @@ export type Rpc = Omit<
8787
* const request = TransactionRequest.toRpc({
8888
* calls: [{
8989
* data: '0xdeadbeef',
90-
* to: '0xcafebabecafebabecafebabecafebabecafebabe',
90+
* to: 'tempo1qr90aw47etlt40k2l6atajh7h2lv4l46hcx5uwlp',
9191
* }],
92-
* feeToken: '0x20c0000000000000000000000000000000000000',
92+
* feeToken: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv0ywuh',
9393
* })
9494
*
9595
* const hash = await provider.request({ // [!code focus]

0 commit comments

Comments
 (0)