@agoric/cosmic-proto 0.4.1-dev-5affa34.0 → 0.4.1-dev-3b478fb.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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The default maximum number of characters in a bech32-encoded hooked address.
3
+ */
4
+ export const DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT: 1024;
5
+ /**
6
+ * @typedef {Record<string, string | (string | null)[] | null>} HookQuery A
7
+ * record of query keys mapped to query values. `null` values denote valueless
8
+ * keys. Array values denote multiple occurrences of a key:
9
+ *
10
+ * { key: null } // '?key'
11
+ * { key: 'value' } // '?key=value'
12
+ * { key: ['value1', 'value2', 'value3'] } // '?key=value1&key=value2&key=value3'
13
+ * { key: ['value1', null, 'value3'] } // '?key=value1&key&key=value3'
14
+ */
15
+ export const BASE_ADDRESS_LENGTH_BYTES: 2;
16
+ export function decodeBech32(specimen: string, charLimit?: number): {
17
+ prefix: string;
18
+ bytes: Uint8Array;
19
+ };
20
+ export function encodeBech32(humanReadablePart: string, bytes: ArrayLike<number>, charLimit?: number): string;
21
+ export function joinHookedAddress(baseAddress: string, hookData: ArrayLike<number>, charLimit?: number): string;
22
+ export function encodeAddressHook(baseAddress: string, query: HookQuery, charLimit?: number): string;
23
+ export function decodeAddressHook(addressHook: string, charLimit?: number): {
24
+ baseAddress: string;
25
+ query: HookQuery;
26
+ };
27
+ export function splitHookedAddressUnsafe(specimen: string, charLimit?: number): string | {
28
+ baseAddress: string;
29
+ hookData: Uint8Array;
30
+ };
31
+ export function splitHookedAddress(specimen: string, charLimit?: number): {
32
+ baseAddress: string;
33
+ hookData: Uint8Array;
34
+ };
35
+ /**
36
+ * A
37
+ * record of query keys mapped to query values. `null` values denote valueless
38
+ * keys. Array values denote multiple occurrences of a key:
39
+ *
40
+ * { key: null } // '?key'
41
+ * { key: 'value' } // '?key=value'
42
+ * { key: ['value1', 'value2', 'value3'] } // '?key=value1&key=value2&key=value3'
43
+ * { key: ['value1', null, 'value3'] } // '?key=value1&key&key=value3'
44
+ */
45
+ export type HookQuery = Record<string, string | (string | null)[] | null>;
@@ -0,0 +1,204 @@
1
+ /**
2
+ * This module provides functions for encoding and decoding address hooks
3
+ * which are comprised of a bech32 base address with an HTTP query string, all
4
+ * wrapped in a bech32 envelope.
5
+ *
6
+ * @module address-hooks.js
7
+ * @example
8
+ *
9
+ * import {
10
+ * encodeAddressHook,
11
+ * decodeAddressHook,
12
+ * } from '@agoric/cosmic-proto/address-hooks.js';
13
+ *
14
+ * const baseAddress = 'agoric1qqp0e5ys';
15
+ * const query = { key: 'value', foo: ['bar', 'baz'] };
16
+ *
17
+ * const addressHook = encodeAddressHook(baseAddress, query);
18
+ * // 'agoric10rchqqplvehk70tzv9ezven0du7kyct6ye4k27faweskcat9qqqstnf2eq'
19
+ *
20
+ * addressHook.startsWith('agoric10rch');
21
+ * // true
22
+ *
23
+ * const decoded = decodeAddressHook(addressHook);
24
+ * // {
25
+ * // baseAddress: 'agoric1qqp0e5ys',
26
+ * // query: [Object: null prototype] { foo: [ 'bar', 'baz' ], key: 'value' }
27
+ * // }
28
+ */
29
+ /* eslint-disable no-bitwise */
30
+ import { bech32 } from 'bech32';
31
+ import queryString from 'query-string';
32
+ // ADDRESS_HOOK_VERSION is the version of the address hook format used in this
33
+ // module.
34
+ const ADDRESS_HOOK_VERSION = 0;
35
+ if ((ADDRESS_HOOK_VERSION & 0x0f) !== ADDRESS_HOOK_VERSION) {
36
+ throw Error(`ADDRESS_HOOK_VERSION ${ADDRESS_HOOK_VERSION} exceeds 0x0f`);
37
+ }
38
+ // AddressHookMagic is a magic byte prefix that identifies a hooked address.
39
+ // Chosen to make bech32 address hooks that look like "agoric10rch..."
40
+ const ADDRESS_HOOK_MAGIC = new Uint8Array([
41
+ 0x78,
42
+ 0xf1,
43
+ 0x70 | ADDRESS_HOOK_VERSION,
44
+ ]);
45
+ /**
46
+ * The default maximum number of characters in a bech32-encoded hooked address.
47
+ */
48
+ export const DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT = 1024;
49
+ /**
50
+ * @typedef {Record<string, string | (string | null)[] | null>} HookQuery A
51
+ * record of query keys mapped to query values. `null` values denote valueless
52
+ * keys. Array values denote multiple occurrences of a key:
53
+ *
54
+ * { key: null } // '?key'
55
+ * { key: 'value' } // '?key=value'
56
+ * { key: ['value1', 'value2', 'value3'] } // '?key=value1&key=value2&key=value3'
57
+ * { key: ['value1', null, 'value3'] } // '?key=value1&key&key=value3'
58
+ */
59
+ export const BASE_ADDRESS_LENGTH_BYTES = 2;
60
+ /**
61
+ * @param {string} specimen
62
+ * @param {number} [charLimit]
63
+ * @returns {{ prefix: string; bytes: Uint8Array }}
64
+ */
65
+ export const decodeBech32 = (specimen, charLimit = DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT) => {
66
+ const { prefix, words } = bech32.decode(specimen, charLimit);
67
+ const rawBytes = bech32.fromWords(words);
68
+ const bytes = new Uint8Array(rawBytes);
69
+ return { prefix, bytes };
70
+ };
71
+ /**
72
+ * @param {string} humanReadablePart
73
+ * @param {ArrayLike<number>} bytes
74
+ * @param {number} [charLimit]
75
+ * @returns {string}
76
+ */
77
+ export const encodeBech32 = (humanReadablePart, bytes, charLimit = DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT) => {
78
+ const words = bech32.toWords(bytes);
79
+ return bech32.encode(humanReadablePart, words, charLimit);
80
+ };
81
+ /**
82
+ * Join raw base address bytes and hook data into a bech32-encoded hooked
83
+ * address. The bech32-payload is:
84
+ *
85
+ * | offset | 0 | 3 | 3+len(baseAddress) | len(payload)-2 |
86
+ * | ------ | ----- | ----------- | ------------------ | ---------------- |
87
+ * | data | magic | baseAddress | hookData | len(baseAddress) |
88
+ *
89
+ * `magic` is a 3-byte prefix that identifies a hooked address and its version
90
+ * nibble, whose value is 4 bits (between 0 and 0xf (15)). Currently, the only
91
+ * supported version is 0.
92
+ *
93
+ * 0x78, 0xf1, (0x70 | ADDRESS_HOOK_VERSION),
94
+ *
95
+ * This magic prefix encodes as `0rch`, regardless of the version or HRP (e.g.
96
+ * `agoric10rch<rest of payload as bech32><bech32 checksum>`).
97
+ *
98
+ * @param {string} baseAddress
99
+ * @param {ArrayLike<number>} hookData
100
+ * @param {number} [charLimit]
101
+ * @returns {string}
102
+ */
103
+ export const joinHookedAddress = (baseAddress, hookData, charLimit = DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT) => {
104
+ const { prefix, bytes } = decodeBech32(baseAddress, charLimit);
105
+ const baseAddressLength = bytes.length;
106
+ const b = baseAddressLength;
107
+ const hd = hookData.length;
108
+ const maxBaseAddressLength = 2 ** (BASE_ADDRESS_LENGTH_BYTES * 8);
109
+ if (b >= maxBaseAddressLength) {
110
+ throw RangeError(`Base address length 0x${b.toString(16)} exceeds maximum 0x${maxBaseAddressLength.toString(16)}`);
111
+ }
112
+ if (!Number.isSafeInteger(hd) || hd < 0) {
113
+ throw RangeError(`Hook data length ${hd} is not a non-negative integer`);
114
+ }
115
+ const magicLength = ADDRESS_HOOK_MAGIC.length;
116
+ const hookBuf = new Uint8Array(magicLength + b + hd + BASE_ADDRESS_LENGTH_BYTES);
117
+ hookBuf.set(ADDRESS_HOOK_MAGIC, 0);
118
+ hookBuf.set(bytes, magicLength);
119
+ hookBuf.set(hookData, magicLength + b);
120
+ // Append the address length bytes, since we've already ensured these do not
121
+ // exceed maxBaseAddressLength above. These are big-endian because the length
122
+ // is at the end of the payload, so if we want to support more bytes for the
123
+ // length, we just need encroach further into the payload. We can do that
124
+ // without changing the meaning of the bytes at the end of existing payloads.
125
+ let len = b;
126
+ for (let i = 0; i < BASE_ADDRESS_LENGTH_BYTES; i += 1) {
127
+ hookBuf[hookBuf.length - 1 - i] = len & 0xff;
128
+ len >>>= 8;
129
+ }
130
+ return encodeBech32(prefix, hookBuf, charLimit);
131
+ };
132
+ /**
133
+ * @param {string} baseAddress
134
+ * @param {HookQuery} query
135
+ * @param {number} [charLimit]
136
+ */
137
+ export const encodeAddressHook = (baseAddress, query, charLimit) => {
138
+ const queryStr = queryString.stringify(query);
139
+ const te = new TextEncoder();
140
+ const hookData = te.encode(`?${queryStr}`);
141
+ return joinHookedAddress(baseAddress, hookData, charLimit);
142
+ };
143
+ /**
144
+ * @param {string} addressHook
145
+ * @param {number} [charLimit]
146
+ * @returns {{ baseAddress: string; query: HookQuery }}
147
+ */
148
+ export const decodeAddressHook = (addressHook, charLimit) => {
149
+ const { baseAddress, hookData } = splitHookedAddress(addressHook, charLimit);
150
+ const hookStr = new TextDecoder().decode(hookData);
151
+ if (hookStr && !hookStr.startsWith('?')) {
152
+ throw Error(`Hook data does not start with '?': ${hookStr}`);
153
+ }
154
+ /** @type {HookQuery} */
155
+ const query = queryString.parse(hookStr);
156
+ return { baseAddress, query };
157
+ };
158
+ /**
159
+ * @param {string} specimen
160
+ * @param {number} [charLimit]
161
+ * @returns {string | { baseAddress: string; hookData: Uint8Array }}
162
+ */
163
+ export const splitHookedAddressUnsafe = (specimen, charLimit = DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT) => {
164
+ const { prefix, bytes } = decodeBech32(specimen, charLimit);
165
+ const magicLength = ADDRESS_HOOK_MAGIC.length;
166
+ for (let i = 0; i < magicLength; i += 1) {
167
+ if (bytes[i] !== ADDRESS_HOOK_MAGIC[i]) {
168
+ return { baseAddress: specimen, hookData: new Uint8Array() };
169
+ }
170
+ }
171
+ let len = 0;
172
+ for (let i = BASE_ADDRESS_LENGTH_BYTES - 1; i >= 0; i -= 1) {
173
+ const byte = bytes.at(-i - 1);
174
+ if (byte === undefined) {
175
+ return `Cannot get base address length from byte ${-i - 1} of ${bytes.length}`;
176
+ }
177
+ len <<= 8;
178
+ len |= byte;
179
+ }
180
+ const b = len;
181
+ if (b > bytes.length - BASE_ADDRESS_LENGTH_BYTES - magicLength) {
182
+ return `Base address length 0x${b.toString(16)} is longer than specimen length ${bytes.length - BASE_ADDRESS_LENGTH_BYTES - magicLength}`;
183
+ }
184
+ const baseAddressBuf = bytes.subarray(magicLength, magicLength + b);
185
+ const baseAddress = encodeBech32(prefix, baseAddressBuf, charLimit);
186
+ const hookData = bytes.subarray(magicLength + b, -BASE_ADDRESS_LENGTH_BYTES);
187
+ return { baseAddress, hookData };
188
+ };
189
+ /**
190
+ * @param {string} specimen
191
+ * @param {number} [charLimit]
192
+ * @returns {{
193
+ * baseAddress: string;
194
+ * hookData: Uint8Array;
195
+ * }}
196
+ */
197
+ export const splitHookedAddress = (specimen, charLimit) => {
198
+ const result = splitHookedAddressUnsafe(specimen, charLimit);
199
+ if (typeof result === 'object') {
200
+ return result;
201
+ }
202
+ throw Error(result);
203
+ };
204
+ //# sourceMappingURL=address-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-hooks.js","sourceRoot":"","sources":["../src/address-hooks.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,8EAA8E;AAC9E,UAAU;AACV,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,KAAK,oBAAoB,EAAE,CAAC;IAC3D,MAAM,KAAK,CAAC,wBAAwB,oBAAoB,eAAe,CAAC,CAAC;AAC3E,CAAC;AAED,4EAA4E;AAC5E,sEAAsE;AACtE,MAAM,kBAAkB,GAAG,IAAI,UAAU,CAAC;IACxC,IAAI;IACJ,IAAI;IACJ,IAAI,GAAG,oBAAoB;CAC5B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;AAEtD;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,QAAQ,EACR,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,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC,CAAC"}
@@ -99,7 +99,7 @@ export declare function writeVarint64(val: {
99
99
  lo: number;
100
100
  hi: number;
101
101
  }, buf: Uint8Array | number[], pos: number): void;
102
- export declare function int64Length(lo: number, hi: number): 1 | 8 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10;
102
+ export declare function int64Length(lo: number, hi: number): 2 | 8 | 1 | 3 | 4 | 5 | 6 | 7 | 9 | 10;
103
103
  export declare function writeFixed32(val: number, buf: Uint8Array | number[], pos: number): void;
104
104
  export declare function writeByte(val: number, buf: Uint8Array | number[], pos: number): void;
105
105
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/cosmic-proto",
3
- "version": "0.4.1-dev-5affa34.0+5affa34",
3
+ "version": "0.4.1-dev-3b478fb.0+3b478fb",
4
4
  "description": "Protobuf stubs for the Agoric cosmos-sdk module",
5
5
  "keywords": [],
6
6
  "author": "Agoric",
@@ -20,6 +20,10 @@
20
20
  "default": "./dist/index.js"
21
21
  },
22
22
  "./package.json": "./package.json",
23
+ "./address-hooks.js": {
24
+ "types": "./dist/address-hooks.d.ts",
25
+ "default": "./dist/address-hooks.js"
26
+ },
23
27
  "./agoric/*.js": {
24
28
  "types": "./dist/codegen/agoric/*.d.ts",
25
29
  "default": "./dist/codegen/agoric/*.js"
@@ -144,11 +148,12 @@
144
148
  "access": "public"
145
149
  },
146
150
  "devDependencies": {
147
- "@agoric/cosmos": "0.34.2-dev-5affa34.0+5affa34",
151
+ "@agoric/cosmos": "0.34.2-dev-3b478fb.0+3b478fb",
148
152
  "@ava/typescript": "^4.1.0",
149
153
  "@cosmology/telescope": "https://gitpkg.vercel.app/agoric-labs/telescope/packages/telescope?8d2c2f6ba637a5578eead09a7368dc41c262a9d0",
150
154
  "@endo/bundle-source": "^3.5.0",
151
155
  "@endo/import-bundle": "^1.3.2",
156
+ "@endo/ses-ava": "^1.2.8",
152
157
  "ava": "^5.3.1",
153
158
  "rimraf": "^5.0.0",
154
159
  "tsd": "^0.31.1",
@@ -156,7 +161,9 @@
156
161
  },
157
162
  "dependencies": {
158
163
  "@endo/base64": "^1.0.9",
159
- "@endo/init": "^1.1.7"
164
+ "@endo/init": "^1.1.7",
165
+ "bech32": "^2.0.0",
166
+ "query-string": "^9.1.1"
160
167
  },
161
168
  "resolutions": {
162
169
  "**/axios": "^1.6.7",
@@ -173,5 +180,5 @@
173
180
  "test/**/*.test.*"
174
181
  ]
175
182
  },
176
- "gitHead": "5affa34beb10ed922683ac7a972a7c447862c1a4"
183
+ "gitHead": "3b478fb9e3fe7ded8dec1e83bab68760571f9071"
177
184
  }