wowok 2.2.4 → 2.2.5
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/dist/cjs/_deps/bcs/bcs-type.d.ts +127 -0
- package/dist/cjs/_deps/bcs/bcs-type.js +1 -0
- package/dist/cjs/_deps/bcs/bcs.d.ts +49 -0
- package/dist/cjs/_deps/bcs/bcs.js +1 -0
- package/dist/cjs/_deps/bcs/index.d.ts +16 -0
- package/dist/cjs/_deps/bcs/index.js +1 -0
- package/dist/cjs/_deps/bcs/reader.d.ts +15 -0
- package/dist/cjs/_deps/bcs/reader.js +1 -0
- package/dist/cjs/_deps/bcs/types.d.ts +24 -0
- package/dist/cjs/_deps/bcs/types.js +1 -0
- package/dist/cjs/_deps/bcs/uleb.d.ts +5 -0
- package/dist/cjs/_deps/bcs/uleb.js +1 -0
- package/dist/cjs/_deps/bcs/utils.d.ts +4 -0
- package/dist/cjs/_deps/bcs/utils.js +1 -0
- package/dist/cjs/_deps/bcs/writer.d.ts +28 -0
- package/dist/cjs/_deps/bcs/writer.js +1 -0
- package/dist/cjs/_deps/utils/b58.d.ts +2 -0
- package/dist/cjs/_deps/utils/b58.js +1 -0
- package/dist/cjs/_deps/utils/b64.d.ts +2 -0
- package/dist/cjs/_deps/utils/b64.js +1 -0
- package/dist/cjs/_deps/utils/chunk.d.ts +1 -0
- package/dist/cjs/_deps/utils/chunk.js +1 -0
- package/dist/cjs/_deps/utils/dataloader.d.ts +43 -0
- package/dist/cjs/_deps/utils/dataloader.js +1 -0
- package/dist/cjs/_deps/utils/hex.d.ts +2 -0
- package/dist/cjs/_deps/utils/hex.js +1 -0
- package/dist/cjs/_deps/utils/index.d.ts +7 -0
- package/dist/cjs/_deps/utils/index.js +1 -0
- package/dist/cjs/_deps/utils/types.d.ts +4 -0
- package/dist/cjs/_deps/utils/types.js +1 -0
- package/dist/cjs/_deps/utils/with-resolver.d.ts +6 -0
- package/dist/cjs/_deps/utils/with-resolver.js +1 -0
- package/dist/cjs/bcs/bcs.d.ts +245 -245
- package/dist/cjs/bcs/bcs.js +1 -1
- package/dist/cjs/bcs/effects.d.ts +193 -193
- package/dist/cjs/bcs/effects.js +1 -1
- package/dist/cjs/bcs/index.d.ts +1 -1
- package/dist/cjs/bcs/index.js +1 -1
- package/dist/cjs/bcs/pure.d.ts +1 -1
- package/dist/cjs/bcs/pure.js +1 -1
- package/dist/cjs/bcs/type-tag-serializer.js +1 -1
- package/dist/cjs/cryptography/keypair.js +1 -1
- package/dist/cjs/cryptography/mnemonics.js +1 -1
- package/dist/cjs/cryptography/publickey.js +1 -1
- package/dist/cjs/cryptography/signature.js +1 -1
- package/dist/cjs/experimental/client.d.ts +1 -1
- package/dist/cjs/grpc/core.js +1 -1
- package/dist/cjs/jsonRpc/client.js +1 -1
- package/dist/cjs/jsonRpc/core.js +1 -1
- package/dist/cjs/jsonRpc/json-rpc-resolver.js +1 -1
- package/dist/cjs/keypairs/falcon512/publickey.js +1 -1
- package/dist/cjs/multisig/publickey.js +1 -1
- package/dist/cjs/multisig/signer.js +1 -1
- package/dist/cjs/transactions/Commands.js +1 -1
- package/dist/cjs/transactions/Inputs.d.ts +1 -1
- package/dist/cjs/transactions/Inputs.js +1 -1
- package/dist/cjs/transactions/Transaction.d.ts +5 -5
- package/dist/cjs/transactions/Transaction.js +1 -1
- package/dist/cjs/transactions/TransactionData.js +1 -1
- package/dist/cjs/transactions/__tests__/Transaction.test.js +1 -1
- package/dist/cjs/transactions/__tests__/bcs.test.js +1 -1
- package/dist/cjs/transactions/data/internal.d.ts +2 -2
- package/dist/cjs/transactions/data/v1.d.ts +2 -2
- package/dist/cjs/transactions/data/v1.js +1 -1
- package/dist/cjs/transactions/data/v2.d.ts +1 -1
- package/dist/cjs/transactions/executor/parallel.js +1 -1
- package/dist/cjs/transactions/executor/serial.js +1 -1
- package/dist/cjs/transactions/pure.d.ts +1 -1
- package/dist/cjs/transactions/pure.js +1 -1
- package/dist/cjs/transactions/serializer.d.ts +1 -1
- package/dist/cjs/utils/dynamic-fields.js +1 -1
- package/dist/cjs/utils/index.d.ts +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/sui-types.js +1 -1
- package/dist/cjs/verify/verify.js +1 -1
- package/dist/cjs/w/call/arbitration.js +1 -1
- package/dist/cjs/w/call/base.js +1 -1
- package/dist/cjs/w/call/contact.js +1 -1
- package/dist/cjs/w/call/demand.js +1 -1
- package/dist/cjs/w/call/guard.js +1 -1
- package/dist/cjs/w/call/machine.js +1 -1
- package/dist/cjs/w/call/personal.js +1 -1
- package/dist/cjs/w/call/repository.js +1 -1
- package/dist/cjs/w/call/reward.js +1 -1
- package/dist/cjs/w/call/service.js +1 -1
- package/dist/cjs/w/call/treasury.js +1 -1
- package/dist/cjs/w/local/storage.js +1 -1
- package/dist/cjs/w/local/util.js +1 -1
- package/dist/cjs/w/local/wip.js +1 -1
- package/dist/cjs/w/messenger/messenger-api.js +1 -1
- package/dist/cjs/w/messenger/messenger.js +1 -1
- package/dist/cjs/w/messenger/pq/crypto.js +1 -1
- package/dist/cjs/w/messenger/storage.js +1 -1
- package/dist/cjs/w/query/object.js +1 -1
- package/dist/esm/_deps/bcs/bcs-type.d.ts +127 -0
- package/dist/esm/_deps/bcs/bcs-type.js +1 -0
- package/dist/esm/_deps/bcs/bcs.d.ts +49 -0
- package/dist/esm/_deps/bcs/bcs.js +1 -0
- package/dist/esm/_deps/bcs/index.d.ts +16 -0
- package/dist/esm/_deps/bcs/index.js +1 -0
- package/dist/esm/_deps/bcs/reader.d.ts +15 -0
- package/dist/esm/_deps/bcs/reader.js +1 -0
- package/dist/esm/_deps/bcs/types.d.ts +24 -0
- package/dist/esm/_deps/bcs/types.js +1 -0
- package/dist/esm/_deps/bcs/uleb.d.ts +5 -0
- package/dist/esm/_deps/bcs/uleb.js +1 -0
- package/dist/esm/_deps/bcs/utils.d.ts +4 -0
- package/dist/esm/_deps/bcs/utils.js +1 -0
- package/dist/esm/_deps/bcs/writer.d.ts +28 -0
- package/dist/esm/_deps/bcs/writer.js +1 -0
- package/dist/esm/_deps/utils/b58.d.ts +2 -0
- package/dist/esm/_deps/utils/b58.js +1 -0
- package/dist/esm/_deps/utils/b64.d.ts +2 -0
- package/dist/esm/_deps/utils/b64.js +1 -0
- package/dist/esm/_deps/utils/chunk.d.ts +1 -0
- package/dist/esm/_deps/utils/chunk.js +1 -0
- package/dist/esm/_deps/utils/dataloader.d.ts +43 -0
- package/dist/esm/_deps/utils/dataloader.js +1 -0
- package/dist/esm/_deps/utils/hex.d.ts +2 -0
- package/dist/esm/_deps/utils/hex.js +1 -0
- package/dist/esm/_deps/utils/index.d.ts +7 -0
- package/dist/esm/_deps/utils/index.js +1 -0
- package/dist/esm/_deps/utils/types.d.ts +4 -0
- package/dist/esm/_deps/utils/types.js +1 -0
- package/dist/esm/_deps/utils/with-resolver.d.ts +6 -0
- package/dist/esm/_deps/utils/with-resolver.js +1 -0
- package/dist/esm/bcs/bcs.d.ts +245 -245
- package/dist/esm/bcs/bcs.js +1 -1
- package/dist/esm/bcs/effects.d.ts +193 -193
- package/dist/esm/bcs/effects.js +1 -1
- package/dist/esm/bcs/index.d.ts +1 -1
- package/dist/esm/bcs/index.js +1 -1
- package/dist/esm/bcs/pure.d.ts +1 -1
- package/dist/esm/bcs/pure.js +1 -1
- package/dist/esm/bcs/type-tag-serializer.js +1 -1
- package/dist/esm/cryptography/keypair.js +1 -1
- package/dist/esm/cryptography/mnemonics.js +1 -1
- package/dist/esm/cryptography/publickey.js +1 -1
- package/dist/esm/cryptography/signature.js +1 -1
- package/dist/esm/experimental/client.d.ts +1 -1
- package/dist/esm/grpc/core.js +1 -1
- package/dist/esm/jsonRpc/client.js +1 -1
- package/dist/esm/jsonRpc/core.js +1 -1
- package/dist/esm/jsonRpc/json-rpc-resolver.js +1 -1
- package/dist/esm/keypairs/falcon512/publickey.js +1 -1
- package/dist/esm/multisig/publickey.js +1 -1
- package/dist/esm/multisig/signer.js +1 -1
- package/dist/esm/transactions/Commands.js +1 -1
- package/dist/esm/transactions/Inputs.d.ts +1 -1
- package/dist/esm/transactions/Inputs.js +1 -1
- package/dist/esm/transactions/Transaction.d.ts +5 -5
- package/dist/esm/transactions/Transaction.js +1 -1
- package/dist/esm/transactions/TransactionData.js +1 -1
- package/dist/esm/transactions/__tests__/Transaction.test.js +1 -1
- package/dist/esm/transactions/__tests__/bcs.test.js +1 -1
- package/dist/esm/transactions/data/internal.d.ts +2 -2
- package/dist/esm/transactions/data/v1.d.ts +2 -2
- package/dist/esm/transactions/data/v1.js +1 -1
- package/dist/esm/transactions/data/v2.d.ts +1 -1
- package/dist/esm/transactions/executor/parallel.js +1 -1
- package/dist/esm/transactions/executor/serial.js +1 -1
- package/dist/esm/transactions/pure.d.ts +1 -1
- package/dist/esm/transactions/pure.js +1 -1
- package/dist/esm/transactions/serializer.d.ts +1 -1
- package/dist/esm/utils/dynamic-fields.js +1 -1
- package/dist/esm/utils/index.d.ts +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/sui-types.js +1 -1
- package/dist/esm/verify/verify.js +1 -1
- package/dist/esm/w/call/arbitration.js +1 -1
- package/dist/esm/w/call/base.js +1 -1
- package/dist/esm/w/call/contact.js +1 -1
- package/dist/esm/w/call/demand.js +1 -1
- package/dist/esm/w/call/guard.js +1 -1
- package/dist/esm/w/call/machine.js +1 -1
- package/dist/esm/w/call/personal.js +1 -1
- package/dist/esm/w/call/repository.js +1 -1
- package/dist/esm/w/call/reward.js +1 -1
- package/dist/esm/w/call/service.js +1 -1
- package/dist/esm/w/call/treasury.js +1 -1
- package/dist/esm/w/local/storage.js +1 -1
- package/dist/esm/w/local/util.js +1 -1
- package/dist/esm/w/local/wip.js +1 -1
- package/dist/esm/w/messenger/messenger-api.js +1 -1
- package/dist/esm/w/messenger/messenger.js +1 -1
- package/dist/esm/w/messenger/pq/crypto.js +1 -1
- package/dist/esm/w/messenger/storage.js +1 -1
- package/dist/esm/w/query/object.js +1 -1
- package/package.json +1 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ulebEncode}from'./uleb.js';import{encodeStr}from'./utils.js';export class BcsWriter{['dataView'];['bytePosition']=0x0;['size'];['maxSize'];['allocateSize'];constructor({initialSize:initialSize=0x400,maxSize:maxSize=Infinity,allocateSize:allocateSize=0x400}={}){this['size']=initialSize,this['maxSize']=maxSize,this['allocateSize']=allocateSize,this['dataView']=new DataView(new ArrayBuffer(initialSize));}['ensureSizeOrGrow'](a){const b=this['bytePosition']+a;if(b>this['size']){const c=Math['min'](this['maxSize'],Math['max'](this['size']+b,this['size']+this['allocateSize']));if(b>c)throw new Error('Attempting\x20to\x20serialize\x20to\x20BCS,\x20but\x20buffer\x20does\x20not\x20have\x20enough\x20size.\x20Allocated\x20size:\x20'+this['size']+',\x20Max\x20size:\x20'+this['maxSize']+',\x20Required\x20size:\x20'+b);this['size']=c;const d=new ArrayBuffer(this['size']);new Uint8Array(d)['set'](new Uint8Array(this['dataView']['buffer'])),this['dataView']=new DataView(d);}}['shift'](a){return this['bytePosition']+=a,this;}['write8'](a){return this['ensureSizeOrGrow'](0x1),this['dataView']['setUint8'](this['bytePosition'],Number(a)),this['shift'](0x1);}['writeBytes'](a){this['ensureSizeOrGrow'](a['length']);for(let b=0x0;b<a['length'];b++){this['dataView']['setUint8'](this['bytePosition']+b,a[b]);}return this['shift'](a['length']);}['write16'](a){return this['ensureSizeOrGrow'](0x2),this['dataView']['setUint16'](this['bytePosition'],Number(a),!![]),this['shift'](0x2);}['write32'](a){return this['ensureSizeOrGrow'](0x4),this['dataView']['setUint32'](this['bytePosition'],Number(a),!![]),this['shift'](0x4);}['write64'](a){return toLittleEndian(BigInt(a),0x8)['forEach'](b=>this['write8'](b)),this;}['write128'](a){return toLittleEndian(BigInt(a),0x10)['forEach'](b=>this['write8'](b)),this;}['write256'](a){return toLittleEndian(BigInt(a),0x20)['forEach'](b=>this['write8'](b)),this;}['writeULEB'](a){return ulebEncode(a)['forEach'](b=>this['write8'](b)),this;}['writeVec'](a,b){return this['writeULEB'](a['length']),Array['from'](a)['forEach']((c,d)=>b(this,c,d,a['length'])),this;}*[Symbol['iterator']](){for(let a=0x0;a<this['bytePosition'];a++){yield this['dataView']['getUint8'](a);}return this['toBytes']();}['toBytes'](){return new Uint8Array(this['dataView']['buffer']['slice'](0x0,this['bytePosition']));}['toString'](a){return encodeStr(this['toBytes'](),a);}}function toLittleEndian(a,b){const c=new Uint8Array(b);let d=0x0;while(a>0x0){c[d]=Number(a%BigInt(0x100)),a=a/BigInt(0x100),d+=0x1;}return c;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{base58}from'@scure/base';export const toBase58=a=>base58['encode'](a);export const fromBase58=a=>base58['decode'](a);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function fromBase64(a){return Uint8Array['from'](atob(a),b=>b['charCodeAt'](0x0));}const CHUNK_SIZE=0x2000;export function toBase64(a){if(a['length']<CHUNK_SIZE)return btoa(String['fromCharCode'](...a));let b='';for(var c=0x0;c<a['length'];c+=CHUNK_SIZE){const d=a['slice'](c,c+CHUNK_SIZE);b+=String['fromCharCode'](...d);}return btoa(b);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function chunk<T>(array: readonly T[], size: number): T[][];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function chunk(a,b){return Array['from']({'length':Math['ceil'](a['length']/b)},(c,d)=>{return a['slice'](d*b,(d+0x1)*b);});}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare class DataLoader<K, V, C = K> {
|
|
2
|
+
constructor(batchLoadFn: DataLoader.BatchLoadFn<K, V>, options?: DataLoader.Options<K, V, C>);
|
|
3
|
+
_batchLoadFn: DataLoader.BatchLoadFn<K, V>;
|
|
4
|
+
_maxBatchSize: number;
|
|
5
|
+
_batchScheduleFn: (cb: () => void) => void;
|
|
6
|
+
_cacheKeyFn: (key: K) => C;
|
|
7
|
+
_cacheMap: DataLoader.CacheMap<C, Promise<V>> | null;
|
|
8
|
+
_batch: Batch<K, V> | null;
|
|
9
|
+
load(key: K): Promise<V>;
|
|
10
|
+
loadMany(keys: ReadonlyArray<K>): Promise<Array<V | Error>>;
|
|
11
|
+
clear(key: K): this;
|
|
12
|
+
clearAll(): this;
|
|
13
|
+
prime(key: K, value: V | Promise<V> | Error): this;
|
|
14
|
+
name: string | null;
|
|
15
|
+
}
|
|
16
|
+
type Batch<K, V> = {
|
|
17
|
+
hasDispatched: boolean;
|
|
18
|
+
keys: Array<K>;
|
|
19
|
+
callbacks: Array<{
|
|
20
|
+
resolve: (value: V) => void;
|
|
21
|
+
reject: (error: Error) => void;
|
|
22
|
+
}>;
|
|
23
|
+
cacheHits?: Array<() => void>;
|
|
24
|
+
};
|
|
25
|
+
export declare namespace DataLoader {
|
|
26
|
+
type CacheMap<K, V> = {
|
|
27
|
+
get(key: K): V | void;
|
|
28
|
+
set(key: K, value: V): any;
|
|
29
|
+
delete(key: K): any;
|
|
30
|
+
clear(): any;
|
|
31
|
+
};
|
|
32
|
+
type BatchLoadFn<K, V> = (keys: ReadonlyArray<K>) => PromiseLike<ArrayLike<V | Error>>;
|
|
33
|
+
type Options<K, V, C = K> = {
|
|
34
|
+
batch?: boolean;
|
|
35
|
+
maxBatchSize?: number;
|
|
36
|
+
batchScheduleFn?: (callback: () => void) => void;
|
|
37
|
+
cache?: boolean;
|
|
38
|
+
cacheKeyFn?: (key: K) => C;
|
|
39
|
+
cacheMap?: CacheMap<C, Promise<V>> | null;
|
|
40
|
+
name?: string | null;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class DataLoader{constructor(a,b){if(typeof a!=='function')throw new TypeError('DataLoader\x20must\x20be\x20constructed\x20with\x20a\x20function\x20which\x20accepts\x20'+('Array<key>\x20and\x20returns\x20Promise<Array<value>>,\x20but\x20got:\x20'+a+'.'));this['_batchLoadFn']=a,this['_maxBatchSize']=getValidMaxBatchSize(b),this['_batchScheduleFn']=getValidBatchScheduleFn(b),this['_cacheKeyFn']=getValidCacheKeyFn(b),this['_cacheMap']=getValidCacheMap(b),this['_batch']=null,this['name']=getValidName(b);}['_batchLoadFn'];['_maxBatchSize'];['_batchScheduleFn'];['_cacheKeyFn'];['_cacheMap'];['_batch'];['load'](a){if(a===null||a===undefined)throw new TypeError('The\x20loader.load()\x20function\x20must\x20be\x20called\x20with\x20a\x20value,\x20but\x20got:\x20'+String(a)+'.');const b=getCurrentBatch(this),c=this['_cacheMap'];let d;if(c){d=this['_cacheKeyFn'](a);const f=c['get'](d);if(f){const g=b['cacheHits']||(b['cacheHits']=[]);return new Promise(h=>{g['push'](()=>{h(f);});});}}b['keys']['push'](a);const e=new Promise((h,i)=>{b['callbacks']['push']({'resolve':h,'reject':i});});return c&&c['set'](d,e),e;}['loadMany'](a){if(!isArrayLike(a))throw new TypeError('The\x20loader.loadMany()\x20function\x20must\x20be\x20called\x20with\x20Array<key>,\x20but\x20got:\x20'+a+'.');const b=[];for(let c=0x0;c<a['length'];c++){b['push'](this['load'](a[c])['catch'](d=>d));}return Promise['all'](b);}['clear'](a){const b=this['_cacheMap'];if(b){const c=this['_cacheKeyFn'](a);b['delete'](c);}return this;}['clearAll'](){const a=this['_cacheMap'];return a&&a['clear'](),this;}['prime'](a,b){const c=this['_cacheMap'];if(c){const d=this['_cacheKeyFn'](a);if(c['get'](d)===undefined){let e;b instanceof Error?(e=Promise['reject'](b),e['catch'](()=>{})):e=Promise['resolve'](b),c['set'](d,e);}}return this;}['name'];}const enqueuePostPromiseJob=typeof process==='object'&&typeof process['nextTick']==='function'?function(a){!resolvedPromise&&(resolvedPromise=Promise['resolve']()),resolvedPromise['then'](()=>{process['nextTick'](a);});}:typeof setImmediate==='function'?function(a){setImmediate(a);}:function(a){setTimeout(a);};let resolvedPromise;function getCurrentBatch(a){const b=a['_batch'];if(b!==null&&!b['hasDispatched']&&b['keys']['length']<a['_maxBatchSize'])return b;const c={'hasDispatched':![],'keys':[],'callbacks':[]};return a['_batch']=c,a['_batchScheduleFn'](()=>{dispatchBatch(a,c);}),c;}function dispatchBatch(a,b){b['hasDispatched']=!![];if(b['keys']['length']===0x0){resolveCacheHits(b);return;}let c;try{c=a['_batchLoadFn'](b['keys']);}catch(d){return failedDispatch(a,b,new TypeError('DataLoader\x20must\x20be\x20constructed\x20with\x20a\x20function\x20which\x20accepts\x20'+'Array<key>\x20and\x20returns\x20Promise<Array<value>>,\x20but\x20the\x20function\x20'+('errored\x20synchronously:\x20'+String(d)+'.')));}if(!c||typeof c['then']!=='function')return failedDispatch(a,b,new TypeError('DataLoader\x20must\x20be\x20constructed\x20with\x20a\x20function\x20which\x20accepts\x20'+'Array<key>\x20and\x20returns\x20Promise<Array<value>>,\x20but\x20the\x20function\x20did\x20'+('not\x20return\x20a\x20Promise:\x20'+String(c)+'.')));Promise['resolve'](c)['then'](f=>{if(!isArrayLike(f))throw new TypeError('DataLoader\x20must\x20be\x20constructed\x20with\x20a\x20function\x20which\x20accepts\x20'+'Array<key>\x20and\x20returns\x20Promise<Array<value>>,\x20but\x20the\x20function\x20did\x20'+('not\x20return\x20a\x20Promise\x20of\x20an\x20Array:\x20'+String(f)+'.'));if(f['length']!==b['keys']['length'])throw new TypeError('DataLoader\x20must\x20be\x20constructed\x20with\x20a\x20function\x20which\x20accepts\x20'+'Array<key>\x20and\x20returns\x20Promise<Array<value>>,\x20but\x20the\x20function\x20did\x20'+'not\x20return\x20a\x20Promise\x20of\x20an\x20Array\x20of\x20the\x20same\x20length\x20as\x20the\x20Array\x20'+'of\x20keys.'+('\x0a\x0aKeys:\x0a'+String(b['keys']))+('\x0a\x0aValues:\x0a'+String(f)));resolveCacheHits(b);for(let g=0x0;g<b['callbacks']['length'];g++){const h=f[g];h instanceof Error?b['callbacks'][g]['reject'](h):b['callbacks'][g]['resolve'](h);}})['catch'](f=>{failedDispatch(a,b,f);});}function failedDispatch(a,b,c){resolveCacheHits(b);for(let d=0x0;d<b['keys']['length'];d++){a['clear'](b['keys'][d]),b['callbacks'][d]['reject'](c);}}function resolveCacheHits(a){if(a['cacheHits'])for(let b=0x0;b<a['cacheHits']['length'];b++){a['cacheHits'][b]();}}function getValidMaxBatchSize(a){const b=!a||a['batch']!==![];if(!b)return 0x1;const c=a&&a['maxBatchSize'];if(c===undefined)return Infinity;if(typeof c!=='number'||c<0x1)throw new TypeError('maxBatchSize\x20must\x20be\x20a\x20positive\x20number:\x20'+c);return c;}function getValidBatchScheduleFn(a){const b=a&&a['batchScheduleFn'];if(b===undefined)return enqueuePostPromiseJob;if(typeof b!=='function')throw new TypeError('batchScheduleFn\x20must\x20be\x20a\x20function:\x20'+b);return b;}function getValidCacheKeyFn(a){const b=a&&a['cacheKeyFn'];if(b===undefined)return c=>c;if(typeof b!=='function')throw new TypeError('cacheKeyFn\x20must\x20be\x20a\x20function:\x20'+b);return b;}function getValidCacheMap(a){const b=!a||a['cache']!==![];if(!b)return null;const c=a&&a['cacheMap'];if(c===undefined)return new Map();if(c!==null){const d=['get','set','delete','clear'],e=d['filter'](f=>c&&typeof c[f]!=='function');if(e['length']!==0x0)throw new TypeError('Custom\x20cacheMap\x20missing\x20methods:\x20'+e['join'](',\x20'));}return c;}function getValidName(a){if(a&&a['name'])return a['name'];return null;}function isArrayLike(a){return typeof a==='object'&&a!==null&&'length'in a&&typeof a['length']==='number'&&(a['length']===0x0||a['length']>0x0&&Object['prototype']['hasOwnProperty']['call'](a,a['length']-0x1));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function fromHex(a){const b=a['startsWith']('0x')?a['slice'](0x2):a,c=b['length']%0x2===0x0?b:'0'+b,d=c['match'](/[0-9a-fA-F]{2}/g)?.['map'](e=>parseInt(e,0x10))??[];if(d['length']!==c['length']/0x2)throw new Error('Invalid\x20hex\x20string\x20'+a);return Uint8Array['from'](d);}export function toHex(a){return a['reduce']((b,c)=>b+c['toString'](0x10)['padStart'](0x2,'0'),'');}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { fromBase58, toBase58 } from "./b58.js";
|
|
2
|
+
export { fromBase64, toBase64 } from "./b64.js";
|
|
3
|
+
export { fromHex, toHex } from "./hex.js";
|
|
4
|
+
export type { Simplify, UnionToIntersection } from "./types.js";
|
|
5
|
+
export { chunk } from "./chunk.js";
|
|
6
|
+
export { promiseWithResolvers, type PromiseWithResolvers, } from "./with-resolver.js";
|
|
7
|
+
export { DataLoader } from "./dataloader.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{fromBase58,toBase58}from'./b58.js';export{fromBase64,toBase64}from'./b64.js';export{fromHex,toHex}from'./hex.js';export{chunk}from'./chunk.js';export{promiseWithResolvers}from'./with-resolver.js';export{DataLoader}from'./dataloader.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function promiseWithResolvers(){let a,b;const c=new Promise((d,e)=>{a=d,b=e;});return{'promise':c,'resolve':a,'reject':b};}
|