wowok 2.2.5 → 2.2.6
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/bcs/bcs.d.ts +1 -1
- package/dist/cjs/bcs/bcs.js +1 -1
- package/dist/cjs/bcs/effects.d.ts +4 -4
- package/dist/cjs/bcs/effects.js +1 -1
- package/dist/cjs/bcs/index.d.ts +2 -2
- package/dist/cjs/bcs/index.js +1 -1
- package/dist/cjs/bcs/type-tag-serializer.js +1 -1
- package/dist/cjs/bcs/types.d.ts +4 -4
- package/dist/cjs/client/index.d.ts +4 -4
- package/dist/cjs/client/index.js +1 -1
- package/dist/cjs/cryptography/keypair.d.ts +2 -2
- package/dist/cjs/cryptography/publickey.js +1 -1
- package/dist/cjs/experimental/client.d.ts +4 -4
- package/dist/cjs/experimental/core.d.ts +17 -17
- package/dist/cjs/experimental/core.js +1 -1
- package/dist/cjs/experimental/errors.d.ts +2 -2
- package/dist/cjs/experimental/errors.js +1 -1
- package/dist/cjs/experimental/index.d.ts +2 -2
- package/dist/cjs/experimental/transports/utils.d.ts +3 -3
- package/dist/cjs/experimental/types.d.ts +3 -3
- package/dist/cjs/faucet/faucet.d.ts +3 -3
- package/dist/cjs/faucet/faucet.js +1 -1
- package/dist/cjs/faucet/index.d.ts +1 -1
- package/dist/cjs/faucet/index.js +1 -1
- package/dist/cjs/grpc/client.d.ts +7 -7
- package/dist/cjs/grpc/client.js +1 -1
- package/dist/cjs/grpc/core.d.ts +15 -15
- package/dist/cjs/grpc/core.js +1 -1
- package/dist/cjs/grpc/index.d.ts +2 -2
- package/dist/cjs/grpc/index.js +1 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/jsonRpc/client.d.ts +24 -24
- package/dist/cjs/jsonRpc/client.js +1 -1
- package/dist/cjs/jsonRpc/core.d.ts +20 -20
- package/dist/cjs/jsonRpc/core.js +1 -1
- package/dist/cjs/jsonRpc/errors.d.ts +3 -3
- package/dist/cjs/jsonRpc/errors.js +1 -1
- package/dist/cjs/jsonRpc/http-transport.js +1 -1
- package/dist/cjs/jsonRpc/index.d.ts +2 -2
- package/dist/cjs/jsonRpc/index.js +1 -1
- package/dist/cjs/jsonRpc/json-rpc-resolver.d.ts +2 -2
- package/dist/cjs/jsonRpc/types/chain.d.ts +4 -4
- package/dist/cjs/jsonRpc/types/changes.d.ts +7 -7
- package/dist/cjs/jsonRpc/types/generated.d.ts +63 -63
- package/dist/cjs/jsonRpc/types/params.d.ts +13 -13
- package/dist/cjs/multisig/publickey.js +1 -1
- package/dist/cjs/transactions/Commands.js +1 -1
- package/dist/cjs/transactions/Inputs.js +1 -1
- package/dist/cjs/transactions/ObjectCache.js +1 -1
- package/dist/cjs/transactions/Transaction.js +1 -1
- package/dist/cjs/transactions/TransactionData.js +1 -1
- package/dist/cjs/transactions/__tests__/bcs.test.js +1 -1
- package/dist/cjs/transactions/data/internal.d.ts +1 -1
- package/dist/cjs/transactions/data/internal.js +1 -1
- package/dist/cjs/transactions/data/v2.js +1 -1
- package/dist/cjs/transactions/executor/caching.d.ts +4 -4
- package/dist/cjs/transactions/executor/parallel.d.ts +4 -4
- package/dist/cjs/transactions/executor/parallel.js +1 -1
- package/dist/cjs/transactions/executor/serial.d.ts +4 -4
- package/dist/cjs/transactions/intents/CoinWithBalance.d.ts +2 -2
- package/dist/cjs/transactions/intents/CoinWithBalance.js +1 -1
- package/dist/cjs/transactions/serializer.d.ts +2 -2
- package/dist/cjs/transactions/serializer.js +1 -1
- package/dist/cjs/transactions/utils.d.ts +4 -4
- package/dist/cjs/transactions/utils.js +1 -1
- package/dist/cjs/utils/constants.d.ts +0 -6
- package/dist/cjs/utils/constants.js +1 -1
- package/dist/cjs/utils/index.d.ts +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/verify/index.d.ts +1 -1
- package/dist/cjs/verify/index.js +1 -1
- package/dist/cjs/verify/verify.d.ts +1 -1
- package/dist/cjs/verify/verify.js +1 -1
- package/dist/cjs/w/call/allocation.js +1 -1
- package/dist/cjs/w/call/arbitration.js +1 -1
- package/dist/cjs/w/call/base.d.ts +6 -6
- 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/entity.js +1 -1
- package/dist/cjs/w/call/guard.js +1 -1
- package/dist/cjs/w/call/passport.d.ts +2 -2
- package/dist/cjs/w/call/passport.js +1 -1
- package/dist/cjs/w/local/account.d.ts +3 -3
- package/dist/cjs/w/local/account.js +1 -1
- package/dist/cjs/w/local/index.d.ts +2 -2
- package/dist/cjs/w/local/index.js +1 -1
- package/dist/cjs/w/local/local.js +1 -1
- package/dist/cjs/w/local/token.js +1 -1
- package/dist/cjs/w/messenger/messenger.js +1 -1
- package/dist/cjs/w/query/event.js +1 -1
- package/dist/cjs/w/query/object.js +1 -1
- package/dist/cjs/w/query/received.js +1 -1
- package/dist/cjs/w/util.js +1 -1
- package/dist/esm/bcs/bcs.d.ts +1 -1
- package/dist/esm/bcs/bcs.js +1 -1
- package/dist/esm/bcs/effects.d.ts +4 -4
- package/dist/esm/bcs/effects.js +1 -1
- package/dist/esm/bcs/index.d.ts +2 -2
- package/dist/esm/bcs/index.js +1 -1
- package/dist/esm/bcs/type-tag-serializer.js +1 -1
- package/dist/esm/bcs/types.d.ts +4 -4
- package/dist/esm/client/index.d.ts +4 -4
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/cryptography/keypair.d.ts +2 -2
- package/dist/esm/cryptography/publickey.js +1 -1
- package/dist/esm/experimental/client.d.ts +4 -4
- package/dist/esm/experimental/core.d.ts +17 -17
- package/dist/esm/experimental/core.js +1 -1
- package/dist/esm/experimental/errors.d.ts +2 -2
- package/dist/esm/experimental/errors.js +1 -1
- package/dist/esm/experimental/index.d.ts +2 -2
- package/dist/esm/experimental/transports/utils.d.ts +3 -3
- package/dist/esm/experimental/types.d.ts +3 -3
- package/dist/esm/faucet/faucet.d.ts +3 -3
- package/dist/esm/faucet/faucet.js +1 -1
- package/dist/esm/faucet/index.d.ts +1 -1
- package/dist/esm/faucet/index.js +1 -1
- package/dist/esm/grpc/client.d.ts +7 -7
- package/dist/esm/grpc/client.js +1 -1
- package/dist/esm/grpc/core.d.ts +15 -15
- package/dist/esm/grpc/core.js +1 -1
- package/dist/esm/grpc/index.d.ts +2 -2
- package/dist/esm/grpc/index.js +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/jsonRpc/client.d.ts +24 -24
- package/dist/esm/jsonRpc/client.js +1 -1
- package/dist/esm/jsonRpc/core.d.ts +20 -20
- package/dist/esm/jsonRpc/core.js +1 -1
- package/dist/esm/jsonRpc/errors.d.ts +3 -3
- package/dist/esm/jsonRpc/errors.js +1 -1
- package/dist/esm/jsonRpc/http-transport.js +1 -1
- package/dist/esm/jsonRpc/index.d.ts +2 -2
- package/dist/esm/jsonRpc/index.js +1 -1
- package/dist/esm/jsonRpc/json-rpc-resolver.d.ts +2 -2
- package/dist/esm/jsonRpc/types/chain.d.ts +4 -4
- package/dist/esm/jsonRpc/types/changes.d.ts +7 -7
- package/dist/esm/jsonRpc/types/generated.d.ts +63 -63
- package/dist/esm/jsonRpc/types/params.d.ts +13 -13
- package/dist/esm/multisig/publickey.js +1 -1
- package/dist/esm/transactions/Commands.js +1 -1
- package/dist/esm/transactions/Inputs.js +1 -1
- package/dist/esm/transactions/ObjectCache.js +1 -1
- package/dist/esm/transactions/Transaction.js +1 -1
- package/dist/esm/transactions/TransactionData.js +1 -1
- package/dist/esm/transactions/__tests__/bcs.test.js +1 -1
- package/dist/esm/transactions/data/internal.d.ts +1 -1
- package/dist/esm/transactions/data/internal.js +1 -1
- package/dist/esm/transactions/data/v2.js +1 -1
- package/dist/esm/transactions/executor/caching.d.ts +4 -4
- package/dist/esm/transactions/executor/parallel.d.ts +4 -4
- package/dist/esm/transactions/executor/parallel.js +1 -1
- package/dist/esm/transactions/executor/serial.d.ts +4 -4
- package/dist/esm/transactions/intents/CoinWithBalance.d.ts +2 -2
- package/dist/esm/transactions/intents/CoinWithBalance.js +1 -1
- package/dist/esm/transactions/serializer.d.ts +2 -2
- package/dist/esm/transactions/serializer.js +1 -1
- package/dist/esm/transactions/utils.d.ts +4 -4
- package/dist/esm/transactions/utils.js +1 -1
- package/dist/esm/utils/constants.d.ts +0 -6
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/index.d.ts +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/verify/index.d.ts +1 -1
- package/dist/esm/verify/index.js +1 -1
- package/dist/esm/verify/verify.d.ts +1 -1
- package/dist/esm/verify/verify.js +1 -1
- package/dist/esm/w/call/allocation.js +1 -1
- package/dist/esm/w/call/arbitration.js +1 -1
- package/dist/esm/w/call/base.d.ts +6 -6
- 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/entity.js +1 -1
- package/dist/esm/w/call/guard.js +1 -1
- package/dist/esm/w/call/passport.d.ts +2 -2
- package/dist/esm/w/call/passport.js +1 -1
- package/dist/esm/w/local/account.d.ts +3 -3
- package/dist/esm/w/local/account.js +1 -1
- package/dist/esm/w/local/index.d.ts +2 -2
- package/dist/esm/w/local/index.js +1 -1
- package/dist/esm/w/local/local.js +1 -1
- package/dist/esm/w/local/token.js +1 -1
- package/dist/esm/w/messenger/messenger.js +1 -1
- package/dist/esm/w/query/event.js +1 -1
- package/dist/esm/w/query/object.js +1 -1
- package/dist/esm/w/query/received.js +1 -1
- package/dist/esm/w/util.js +1 -1
- package/package.json +4 -3
- /package/dist/cjs/utils/{sui-types.d.ts → wow-types.d.ts} +0 -0
- /package/dist/cjs/utils/{sui-types.js → wow-types.js} +0 -0
- /package/dist/esm/utils/{sui-types.d.ts → wow-types.d.ts} +0 -0
- /package/dist/esm/utils/{sui-types.js → wow-types.js} +0 -0
package/dist/cjs/bcs/bcs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { BcsType } from "../_deps/bcs/index.js";
|
|
|
2
2
|
import type { TypeTag as TypeTagType } from "./types.js";
|
|
3
3
|
export declare const Address: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
4
4
|
export declare const ObjectDigest: BcsType<string, string, "ObjectDigest">;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const WowObjectRef: import("../_deps/bcs/bcs-type.js").BcsStruct<{
|
|
6
6
|
objectId: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
7
7
|
version: BcsType<string, string | number | bigint, "u64">;
|
|
8
8
|
digest: BcsType<string, string, "ObjectDigest">;
|
package/dist/cjs/bcs/bcs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bcs,fromBase58,fromBase64,fromHex,toBase58,toBase64,toHex}from'../_deps/bcs/index.js';import{isValidWowAddress,normalizeWowAddress,WOW_ADDRESS_LENGTH}from'../utils/
|
|
1
|
+
import{bcs,fromBase58,fromBase64,fromHex,toBase58,toBase64,toHex}from'../_deps/bcs/index.js';import{isValidWowAddress,normalizeWowAddress,WOW_ADDRESS_LENGTH}from'../utils/wow-types.js';import{TypeTagSerializer}from'./type-tag-serializer.js';function unsafe_u64(a){return bcs['u64']({'name':'unsafe_u64',...a})['transform']({'input':b=>b,'output':b=>Number(b)});}function optionEnum(a){return bcs['enum']('Option',{'None':null,'Some':a});}export const Address=bcs['bytes'](WOW_ADDRESS_LENGTH)['transform']({'validate':a=>{const b=typeof a==='string'?a:toHex(a);if(!b||!isValidWowAddress(normalizeWowAddress(b)))throw new Error('Invalid\x20Wow\x20address\x20'+b);},'input':a=>typeof a==='string'?fromHex(normalizeWowAddress(a)):a,'output':a=>normalizeWowAddress(toHex(a))});export const ObjectDigest=bcs['byteVector']()['transform']({'name':'ObjectDigest','input':a=>fromBase58(a),'output':a=>toBase58(new Uint8Array(a)),'validate':a=>{if(fromBase58(a)['length']!==0x20)throw new Error('ObjectDigest\x20must\x20be\x2032\x20bytes');}});export const WowObjectRef=bcs['struct']('WowObjectRef',{'objectId':Address,'version':bcs['u64'](),'digest':ObjectDigest});export const SharedObjectRef=bcs['struct']('SharedObjectRef',{'objectId':Address,'initialSharedVersion':bcs['u64'](),'mutable':bcs['bool']()});export const ObjectArg=bcs['enum']('ObjectArg',{'ImmOrOwnedObject':WowObjectRef,'SharedObject':SharedObjectRef,'Receiving':WowObjectRef});export const Owner=bcs['enum']('Owner',{'AddressOwner':Address,'ObjectOwner':Address,'Shared':bcs['struct']('Shared',{'initialSharedVersion':bcs['u64']()}),'Immutable':null,'ConsensusAddressOwner':bcs['struct']('ConsensusAddressOwner',{'owner':Address,'startVersion':bcs['u64']()})});export const CallArg=bcs['enum']('CallArg',{'Pure':bcs['struct']('Pure',{'bytes':bcs['byteVector']()['transform']({'input':a=>typeof a==='string'?fromBase64(a):a,'output':a=>toBase64(new Uint8Array(a))})}),'Object':ObjectArg});const InnerTypeTag=bcs['enum']('TypeTag',{'bool':null,'u8':null,'u64':null,'u128':null,'address':null,'signer':null,'vector':bcs['lazy'](()=>InnerTypeTag),'struct':bcs['lazy'](()=>StructTag),'u16':null,'u32':null,'u256':null});export const TypeTag=InnerTypeTag['transform']({'input':a=>typeof a==='string'?TypeTagSerializer['parseFromStr'](a,!![]):a,'output':a=>TypeTagSerializer['tagToString'](a)});export const Argument=bcs['enum']('Argument',{'GasCoin':null,'Input':bcs['u16'](),'Result':bcs['u16'](),'NestedResult':bcs['tuple']([bcs['u16'](),bcs['u16']()])});export const ProgrammableMoveCall=bcs['struct']('ProgrammableMoveCall',{'package':Address,'module':bcs['string'](),'function':bcs['string'](),'typeArguments':bcs['vector'](TypeTag),'arguments':bcs['vector'](Argument)});export const Command=bcs['enum']('Command',{'MoveCall':ProgrammableMoveCall,'TransferObjects':bcs['struct']('TransferObjects',{'objects':bcs['vector'](Argument),'address':Argument}),'SplitCoins':bcs['struct']('SplitCoins',{'coin':Argument,'amounts':bcs['vector'](Argument)}),'MergeCoins':bcs['struct']('MergeCoins',{'destination':Argument,'sources':bcs['vector'](Argument)}),'Publish':bcs['struct']('Publish',{'modules':bcs['vector'](bcs['byteVector']()['transform']({'input':a=>typeof a==='string'?fromBase64(a):a,'output':a=>toBase64(new Uint8Array(a))})),'dependencies':bcs['vector'](Address)}),'MakeMoveVec':bcs['struct']('MakeMoveVec',{'type':optionEnum(TypeTag)['transform']({'input':a=>a===null?{'None':!![]}:{'Some':a},'output':a=>a['Some']??null}),'elements':bcs['vector'](Argument)}),'Upgrade':bcs['struct']('Upgrade',{'modules':bcs['vector'](bcs['byteVector']()['transform']({'input':a=>typeof a==='string'?fromBase64(a):a,'output':a=>toBase64(new Uint8Array(a))})),'dependencies':bcs['vector'](Address),'package':Address,'ticket':Argument})});export const ProgrammableTransaction=bcs['struct']('ProgrammableTransaction',{'inputs':bcs['vector'](CallArg),'commands':bcs['vector'](Command)});export const TransactionKind=bcs['enum']('TransactionKind',{'ProgrammableTransaction':ProgrammableTransaction,'ChangeEpoch':null,'Genesis':null,'ConsensusCommitPrologue':null});export const TransactionExpiration=bcs['enum']('TransactionExpiration',{'None':null,'Epoch':unsafe_u64()});export const StructTag=bcs['struct']('StructTag',{'address':Address,'module':bcs['string'](),'name':bcs['string'](),'typeParams':bcs['vector'](InnerTypeTag)});export const GasData=bcs['struct']('GasData',{'payment':bcs['vector'](WowObjectRef),'owner':Address,'price':bcs['u64'](),'budget':bcs['u64']()});export const TransactionDataV1=bcs['struct']('TransactionDataV1',{'kind':TransactionKind,'sender':Address,'gasData':GasData,'expiration':TransactionExpiration});export const TransactionData=bcs['enum']('TransactionData',{'V1':TransactionDataV1});export const IntentScope=bcs['enum']('IntentScope',{'TransactionData':null,'TransactionEffects':null,'CheckpointSummary':null,'PersonalMessage':null});export const IntentVersion=bcs['enum']('IntentVersion',{'V0':null});export const AppId=bcs['enum']('AppId',{'Wow':null});export const Intent=bcs['struct']('Intent',{'scope':IntentScope,'version':IntentVersion,'appId':AppId});export function IntentMessage(a){return bcs['struct']('IntentMessage<'+a['name']+'>',{'intent':Intent,'value':a});}export const CompressedSignature=bcs['enum']('CompressedSignature',{'Falcon512':bcs['byteVector']()});export const PublicKey=bcs['enum']('PublicKey',{'Falcon512':bcs['bytes'](0x381)});export const MultiSigPkMap=bcs['struct']('MultiSigPkMap',{'pubKey':PublicKey,'weight':bcs['u8']()});export const MultiSigPublicKey=bcs['struct']('MultiSigPublicKey',{'pk_map':bcs['vector'](MultiSigPkMap),'threshold':bcs['u16']()});export const MultiSig=bcs['struct']('MultiSig',{'sigs':bcs['vector'](CompressedSignature),'bitmap':bcs['u16'](),'multisig_pk':MultiSigPublicKey});export const base64String=bcs['byteVector']()['transform']({'input':a=>typeof a==='string'?fromBase64(a):a,'output':a=>toBase64(new Uint8Array(a))});export const SenderSignedTransaction=bcs['struct']('SenderSignedTransaction',{'intentMessage':IntentMessage(TransactionData),'txSignatures':bcs['vector'](base64String)});export const SenderSignedData=bcs['vector'](SenderSignedTransaction,{'name':'SenderSignedData'});
|
|
@@ -22,7 +22,7 @@ export declare const TransactionEffects: import("../_deps/bcs/bcs-type.js").BcsE
|
|
|
22
22
|
InsufficientCoinBalance: any;
|
|
23
23
|
CoinBalanceOverflow: any;
|
|
24
24
|
PublishErrorNonZeroAddress: any;
|
|
25
|
-
|
|
25
|
+
WowMoveVerificationError: any;
|
|
26
26
|
MovePrimitiveRuntimeError: import("../_deps/bcs/bcs-type.js").BcsType<{
|
|
27
27
|
module: {
|
|
28
28
|
address: string;
|
|
@@ -126,7 +126,7 @@ export declare const TransactionEffects: import("../_deps/bcs/bcs-type.js").BcsE
|
|
|
126
126
|
maxSize: import("../_deps/bcs/bcs-type.js").BcsType<string, string | number | bigint, "u64">;
|
|
127
127
|
}, string>;
|
|
128
128
|
CertificateDenied: any;
|
|
129
|
-
|
|
129
|
+
WowMoveVerificationTimedout: any;
|
|
130
130
|
SharedObjectOperationNotAllowed: any;
|
|
131
131
|
InputObjectDeleted: any;
|
|
132
132
|
ExecutionCancelledDueToSharedObjectCongestion: import("../_deps/bcs/bcs-type.js").BcsStruct<{
|
|
@@ -344,7 +344,7 @@ export declare const TransactionEffects: import("../_deps/bcs/bcs-type.js").BcsE
|
|
|
344
344
|
InsufficientCoinBalance: any;
|
|
345
345
|
CoinBalanceOverflow: any;
|
|
346
346
|
PublishErrorNonZeroAddress: any;
|
|
347
|
-
|
|
347
|
+
WowMoveVerificationError: any;
|
|
348
348
|
MovePrimitiveRuntimeError: import("../_deps/bcs/bcs-type.js").BcsType<{
|
|
349
349
|
module: {
|
|
350
350
|
address: string;
|
|
@@ -448,7 +448,7 @@ export declare const TransactionEffects: import("../_deps/bcs/bcs-type.js").BcsE
|
|
|
448
448
|
maxSize: import("../_deps/bcs/bcs-type.js").BcsType<string, string | number | bigint, "u64">;
|
|
449
449
|
}, string>;
|
|
450
450
|
CertificateDenied: any;
|
|
451
|
-
|
|
451
|
+
WowMoveVerificationTimedout: any;
|
|
452
452
|
SharedObjectOperationNotAllowed: any;
|
|
453
453
|
InputObjectDeleted: any;
|
|
454
454
|
ExecutionCancelledDueToSharedObjectCongestion: import("../_deps/bcs/bcs-type.js").BcsStruct<{
|
package/dist/cjs/bcs/effects.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bcs}from'../_deps/bcs/index.js';import{Address,ObjectDigest,Owner,
|
|
1
|
+
import{bcs}from'../_deps/bcs/index.js';import{Address,ObjectDigest,Owner,WowObjectRef}from'./bcs.js';const PackageUpgradeError=bcs['enum']('PackageUpgradeError',{'UnableToFetchPackage':bcs['struct']('UnableToFetchPackage',{'packageId':Address}),'NotAPackage':bcs['struct']('NotAPackage',{'objectId':Address}),'IncompatibleUpgrade':null,'DigestDoesNotMatch':bcs['struct']('DigestDoesNotMatch',{'digest':bcs['byteVector']()}),'UnknownUpgradePolicy':bcs['struct']('UnknownUpgradePolicy',{'policy':bcs['u8']()}),'PackageIDDoesNotMatch':bcs['struct']('PackageIDDoesNotMatch',{'packageId':Address,'ticketId':Address})}),ModuleId=bcs['struct']('ModuleId',{'address':Address,'name':bcs['string']()}),MoveLocation=bcs['struct']('MoveLocation',{'module':ModuleId,'function':bcs['u16'](),'instruction':bcs['u16'](),'functionName':bcs['option'](bcs['string']())}),CommandArgumentError=bcs['enum']('CommandArgumentError',{'TypeMismatch':null,'InvalidBCSBytes':null,'InvalidUsageOfPureArg':null,'InvalidArgumentToPrivateEntryFunction':null,'IndexOutOfBounds':bcs['struct']('IndexOutOfBounds',{'idx':bcs['u16']()}),'SecondaryIndexOutOfBounds':bcs['struct']('SecondaryIndexOutOfBounds',{'resultIdx':bcs['u16'](),'secondaryIdx':bcs['u16']()}),'InvalidResultArity':bcs['struct']('InvalidResultArity',{'resultIdx':bcs['u16']()}),'InvalidGasCoinUsage':null,'InvalidValueUsage':null,'InvalidObjectByValue':null,'InvalidObjectByMutRef':null,'SharedObjectOperationNotAllowed':null}),TypeArgumentError=bcs['enum']('TypeArgumentError',{'TypeNotFound':null,'ConstraintNotSatisfied':null}),ExecutionFailureStatus=bcs['enum']('ExecutionFailureStatus',{'InsufficientGas':null,'InvalidGasObject':null,'InvariantViolation':null,'FeatureNotYetSupported':null,'MoveObjectTooBig':bcs['struct']('MoveObjectTooBig',{'objectSize':bcs['u64'](),'maxObjectSize':bcs['u64']()}),'MovePackageTooBig':bcs['struct']('MovePackageTooBig',{'objectSize':bcs['u64'](),'maxObjectSize':bcs['u64']()}),'CircularObjectOwnership':bcs['struct']('CircularObjectOwnership',{'object':Address}),'InsufficientCoinBalance':null,'CoinBalanceOverflow':null,'PublishErrorNonZeroAddress':null,'WowMoveVerificationError':null,'MovePrimitiveRuntimeError':bcs['option'](MoveLocation),'MoveAbort':bcs['tuple']([MoveLocation,bcs['u64']()]),'VMVerificationOrDeserializationError':null,'VMInvariantViolation':null,'FunctionNotFound':null,'ArityMismatch':null,'TypeArityMismatch':null,'NonEntryFunctionInvoked':null,'CommandArgumentError':bcs['struct']('CommandArgumentError',{'argIdx':bcs['u16'](),'kind':CommandArgumentError}),'TypeArgumentError':bcs['struct']('TypeArgumentError',{'argumentIdx':bcs['u16'](),'kind':TypeArgumentError}),'UnusedValueWithoutDrop':bcs['struct']('UnusedValueWithoutDrop',{'resultIdx':bcs['u16'](),'secondaryIdx':bcs['u16']()}),'InvalidPublicFunctionReturnType':bcs['struct']('InvalidPublicFunctionReturnType',{'idx':bcs['u16']()}),'InvalidTransferObject':null,'EffectsTooLarge':bcs['struct']('EffectsTooLarge',{'currentSize':bcs['u64'](),'maxSize':bcs['u64']()}),'PublishUpgradeMissingDependency':null,'PublishUpgradeDependencyDowngrade':null,'PackageUpgradeError':bcs['struct']('PackageUpgradeError',{'upgradeError':PackageUpgradeError}),'WrittenObjectsTooLarge':bcs['struct']('WrittenObjectsTooLarge',{'currentSize':bcs['u64'](),'maxSize':bcs['u64']()}),'CertificateDenied':null,'WowMoveVerificationTimedout':null,'SharedObjectOperationNotAllowed':null,'InputObjectDeleted':null,'ExecutionCancelledDueToSharedObjectCongestion':bcs['struct']('ExecutionCancelledDueToSharedObjectCongestion',{'congestedObjects':bcs['vector'](Address)}),'AddressDeniedForCoin':bcs['struct']('AddressDeniedForCoin',{'address':Address,'coinType':bcs['string']()}),'CoinTypeGlobalPause':bcs['struct']('CoinTypeGlobalPause',{'coinType':bcs['string']()}),'ExecutionCancelledDueToRandomnessUnavailable':null}),ExecutionStatus=bcs['enum']('ExecutionStatus',{'Success':null,'Failed':bcs['struct']('ExecutionFailed',{'error':ExecutionFailureStatus,'command':bcs['option'](bcs['u64']())})}),GasCostSummary=bcs['struct']('GasCostSummary',{'computationCost':bcs['u64'](),'storageCost':bcs['u64'](),'storageRebate':bcs['u64'](),'nonRefundableStorageFee':bcs['u64']()}),TransactionEffectsV1=bcs['struct']('TransactionEffectsV1',{'status':ExecutionStatus,'executedEpoch':bcs['u64'](),'gasUsed':GasCostSummary,'modifiedAtVersions':bcs['vector'](bcs['tuple']([Address,bcs['u64']()])),'sharedObjects':bcs['vector'](WowObjectRef),'transactionDigest':ObjectDigest,'created':bcs['vector'](bcs['tuple']([WowObjectRef,Owner])),'mutated':bcs['vector'](bcs['tuple']([WowObjectRef,Owner])),'unwrapped':bcs['vector'](bcs['tuple']([WowObjectRef,Owner])),'deleted':bcs['vector'](WowObjectRef),'unwrappedThenDeleted':bcs['vector'](WowObjectRef),'wrapped':bcs['vector'](WowObjectRef),'gasObject':bcs['tuple']([WowObjectRef,Owner]),'eventsDigest':bcs['option'](ObjectDigest),'dependencies':bcs['vector'](ObjectDigest)}),VersionDigest=bcs['tuple']([bcs['u64'](),ObjectDigest]),ObjectIn=bcs['enum']('ObjectIn',{'NotExist':null,'Exist':bcs['tuple']([VersionDigest,Owner])}),ObjectOut=bcs['enum']('ObjectOut',{'NotExist':null,'ObjectWrite':bcs['tuple']([ObjectDigest,Owner]),'PackageWrite':VersionDigest}),IDOperation=bcs['enum']('IDOperation',{'None':null,'Created':null,'Deleted':null}),EffectsObjectChange=bcs['struct']('EffectsObjectChange',{'inputState':ObjectIn,'outputState':ObjectOut,'idOperation':IDOperation}),UnchangedSharedKind=bcs['enum']('UnchangedSharedKind',{'ReadOnlyRoot':VersionDigest,'MutateDeleted':bcs['u64'](),'ReadDeleted':bcs['u64'](),'Cancelled':bcs['u64'](),'PerEpochConfig':null}),TransactionEffectsV2=bcs['struct']('TransactionEffectsV2',{'status':ExecutionStatus,'executedEpoch':bcs['u64'](),'gasUsed':GasCostSummary,'transactionDigest':ObjectDigest,'gasObjectIndex':bcs['option'](bcs['u32']()),'eventsDigest':bcs['option'](ObjectDigest),'dependencies':bcs['vector'](ObjectDigest),'lamportVersion':bcs['u64'](),'changedObjects':bcs['vector'](bcs['tuple']([Address,EffectsObjectChange])),'unchangedSharedObjects':bcs['vector'](bcs['tuple']([Address,UnchangedSharedKind])),'auxDataDigest':bcs['option'](ObjectDigest)});export const TransactionEffects=bcs['enum']('TransactionEffects',{'V1':TransactionEffectsV1,'V2':TransactionEffectsV2});
|
package/dist/cjs/bcs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { TypeTag } from "./types.js";
|
|
2
2
|
export { TypeTagSerializer } from "./type-tag-serializer.js";
|
|
3
3
|
export { BcsType, BcsStruct, BcsEnum, BcsTuple, type BcsTypeOptions, } from "../_deps/bcs/index.js";
|
|
4
|
-
declare const
|
|
4
|
+
declare const wowBcs: any;
|
|
5
5
|
export { pureBcsSchemaFromTypeName, type ShapeFromPureTypeName, type PureTypeName, } from "./pure.js";
|
|
6
|
-
export {
|
|
6
|
+
export { wowBcs as bcs };
|
package/dist/cjs/bcs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bcs}from'../_deps/bcs/index.js';import{Address,AppId,Argument,CallArg,Command,CompressedSignature,GasData,Intent,IntentMessage,IntentScope,IntentVersion,MultiSig,MultiSigPkMap,MultiSigPublicKey,ObjectArg,ObjectDigest,Owner,ProgrammableMoveCall,ProgrammableTransaction,PublicKey,SenderSignedData,SenderSignedTransaction,SharedObjectRef,StructTag,
|
|
1
|
+
import{bcs}from'../_deps/bcs/index.js';import{Address,AppId,Argument,CallArg,Command,CompressedSignature,GasData,Intent,IntentMessage,IntentScope,IntentVersion,MultiSig,MultiSigPkMap,MultiSigPublicKey,ObjectArg,ObjectDigest,Owner,ProgrammableMoveCall,ProgrammableTransaction,PublicKey,SenderSignedData,SenderSignedTransaction,SharedObjectRef,StructTag,WowObjectRef,TransactionData,TransactionDataV1,TransactionExpiration,TransactionKind,TypeTag}from'./bcs.js';import{TransactionEffects}from'./effects.js';export{TypeTagSerializer}from'./type-tag-serializer.js';export{BcsType,BcsStruct,BcsEnum,BcsTuple}from'../_deps/bcs/index.js';const wowBcs={...bcs,'U8':bcs['u8'](),'U16':bcs['u16'](),'U32':bcs['u32'](),'U64':bcs['u64'](),'U128':bcs['u128'](),'U256':bcs['u256'](),'ULEB128':bcs['uleb128'](),'Bool':bcs['bool'](),'String':bcs['string'](),'Address':Address,'AppId':AppId,'Argument':Argument,'CallArg':CallArg,'Command':Command,'CompressedSignature':CompressedSignature,'GasData':GasData,'Intent':Intent,'IntentMessage':IntentMessage,'IntentScope':IntentScope,'IntentVersion':IntentVersion,'MultiSig':MultiSig,'MultiSigPkMap':MultiSigPkMap,'MultiSigPublicKey':MultiSigPublicKey,'ObjectArg':ObjectArg,'ObjectDigest':ObjectDigest,'Owner':Owner,'ProgrammableMoveCall':ProgrammableMoveCall,'ProgrammableTransaction':ProgrammableTransaction,'PublicKey':PublicKey,'SenderSignedData':SenderSignedData,'SenderSignedTransaction':SenderSignedTransaction,'SharedObjectRef':SharedObjectRef,'StructTag':StructTag,'WowObjectRef':WowObjectRef,'TransactionData':TransactionData,'TransactionDataV1':TransactionDataV1,'TransactionEffects':TransactionEffects,'TransactionExpiration':TransactionExpiration,'TransactionKind':TransactionKind,'TypeTag':TypeTag};export{pureBcsSchemaFromTypeName}from'./pure.js';export{wowBcs as bcs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitGenericParameters}from'../_deps/bcs/index.js';import{normalizeWowAddress}from'../utils/
|
|
1
|
+
import{splitGenericParameters}from'../_deps/bcs/index.js';import{normalizeWowAddress}from'../utils/wow-types.js';const VECTOR_REGEX=/^vector<(.+)>$/,STRUCT_REGEX=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;export class TypeTagSerializer{static['parseFromStr'](a,b=![]){if(a==='address')return{'address':null};else{if(a==='bool')return{'bool':null};else{if(a==='u8')return{'u8':null};else{if(a==='u16')return{'u16':null};else{if(a==='u32')return{'u32':null};else{if(a==='u64')return{'u64':null};else{if(a==='u128')return{'u128':null};else{if(a==='u256')return{'u256':null};else{if(a==='signer')return{'signer':null};}}}}}}}}const c=a['match'](VECTOR_REGEX);if(c)return{'vector':TypeTagSerializer['parseFromStr'](c[0x1],b)};const d=a['match'](STRUCT_REGEX);if(d){const e=b?normalizeWowAddress(d[0x1]):d[0x1];return{'struct':{'address':e,'module':d[0x2],'name':d[0x3],'typeParams':d[0x5]===undefined?[]:TypeTagSerializer['parseStructTypeArgs'](d[0x5],b)}};}throw new Error('Encountered\x20unexpected\x20token\x20when\x20parsing\x20type\x20args\x20for\x20'+a);}static['parseStructTypeArgs'](a,b=![]){return splitGenericParameters(a)['map'](c=>TypeTagSerializer['parseFromStr'](c,b));}static['tagToString'](a){if('bool'in a)return'bool';if('u8'in a)return'u8';if('u16'in a)return'u16';if('u32'in a)return'u32';if('u64'in a)return'u64';if('u128'in a)return'u128';if('u256'in a)return'u256';if('address'in a)return'address';if('signer'in a)return'signer';if('vector'in a)return'vector<'+TypeTagSerializer['tagToString'](a['vector'])+'>';if('struct'in a){const b=a['struct'],c=b['typeParams']['map'](TypeTagSerializer['tagToString'])['join'](',\x20');return b['address']+'::'+b['module']+'::'+b['name']+(c?'<'+c+'>':'');}throw new Error('Invalid\x20TypeTag');}}export function normalizeTypeTag(a){return TypeTagSerializer['tagToString'](TypeTagSerializer['parseFromStr'](a));}
|
package/dist/cjs/bcs/types.d.ts
CHANGED
|
@@ -3,17 +3,17 @@ export type SharedObjectRef = {
|
|
|
3
3
|
initialSharedVersion: number | string;
|
|
4
4
|
mutable: boolean;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
6
|
+
export type WowObjectRef = {
|
|
7
7
|
objectId: string;
|
|
8
8
|
version: number | string;
|
|
9
9
|
digest: string;
|
|
10
10
|
};
|
|
11
11
|
export type ObjectArg = {
|
|
12
|
-
ImmOrOwnedObject:
|
|
12
|
+
ImmOrOwnedObject: WowObjectRef;
|
|
13
13
|
} | {
|
|
14
14
|
SharedObject: SharedObjectRef;
|
|
15
15
|
} | {
|
|
16
|
-
Receiving:
|
|
16
|
+
Receiving: WowObjectRef;
|
|
17
17
|
};
|
|
18
18
|
export type ObjectCallArg = {
|
|
19
19
|
Object: ObjectArg;
|
|
@@ -53,7 +53,7 @@ export type TypeTag = {
|
|
|
53
53
|
u256: null | true;
|
|
54
54
|
};
|
|
55
55
|
export type GasData = {
|
|
56
|
-
payment:
|
|
56
|
+
payment: WowObjectRef[];
|
|
57
57
|
owner: string;
|
|
58
58
|
price: number;
|
|
59
59
|
budget: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type JsonRpcTransport as
|
|
1
|
+
export { type JsonRpcTransport as WowTransport, type JsonRpcTransportRequestOptions as WowTransportRequestOptions, type JsonRpcTransportSubscribeOptions as WowTransportSubscribeOptions, type HttpHeaders, type JsonRpcHTTPTransportOptions as WowHTTPTransportOptions, JsonRpcHTTPTransport as WowHTTPTransport, } from "../jsonRpc/http-transport.js";
|
|
2
2
|
export { getFullnodeUrl, ENTRYPOINT } from "./network.js";
|
|
3
|
-
export { type
|
|
4
|
-
export {
|
|
5
|
-
export type {
|
|
3
|
+
export { type WowJsonRpcClientOptions as WowClientOptions, type PaginationArguments, type OrderArguments, isWowJsonRpcClient as isWowClient, WowJsonRpcClient as WowClient, } from "../jsonRpc/client.js";
|
|
4
|
+
export { WowHTTPStatusError, WowHTTPTransportError, JsonRpcError, } from "../jsonRpc/errors.js";
|
|
5
|
+
export type { WowTransactionBlockResponseOptions, CoinStruct, WowMoveNormalizedType, CoinBalance, PaginatedCoins, WowTransactionBlockResponse, CoinMetadata, ObjectResponseError, ExecuteTransactionBlockParams, } from "../jsonRpc/types/index.js";
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{JsonRpcHTTPTransport as
|
|
1
|
+
export{JsonRpcHTTPTransport as WowHTTPTransport}from'../jsonRpc/http-transport.js';export{getFullnodeUrl,ENTRYPOINT}from'./network.js';export{isWowJsonRpcClient as isWowClient,WowJsonRpcClient as WowClient}from'../jsonRpc/client.js';export{WowHTTPStatusError,WowHTTPTransportError,JsonRpcError}from'../jsonRpc/errors.js';
|
|
@@ -2,7 +2,7 @@ import type { IntentScope } from "./intent.js";
|
|
|
2
2
|
import type { PublicKey } from "./publickey.js";
|
|
3
3
|
import type { SignatureScheme } from "./signature-scheme.js";
|
|
4
4
|
import type { Transaction } from "../transactions/Transaction.js";
|
|
5
|
-
import type { ClientWithCoreApi,
|
|
5
|
+
import type { ClientWithCoreApi, Experimental_WowClientTypes } from "../experimental/index.js";
|
|
6
6
|
export declare const FALCON512_PRIVATE_KEY_SIZE = 1281;
|
|
7
7
|
export declare const PRIVATE_KEY_SIZE = 1281;
|
|
8
8
|
export declare const W_PRIVATE_KEY_PREFIX = "wowprivkey";
|
|
@@ -26,7 +26,7 @@ export declare abstract class Signer {
|
|
|
26
26
|
bytes: string;
|
|
27
27
|
signature: string;
|
|
28
28
|
}>;
|
|
29
|
-
signAndExecuteTransaction({ transaction, client, }: SignAndExecuteOptions): Promise<Omit<
|
|
29
|
+
signAndExecuteTransaction({ transaction, client, }: SignAndExecuteOptions): Promise<Omit<Experimental_WowClientTypes.TransactionResponse, "balanceChanges">>;
|
|
30
30
|
toWowAddress(): string;
|
|
31
31
|
toWAddress(): string;
|
|
32
32
|
abstract getKeyScheme(): SignatureScheme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fromBase64,toBase64}from'../_deps/bcs/index.js';import{blake2b}from'@noble/hashes/blake2b';import{bytesToHex}from'@noble/hashes/utils';import{bcs}from'../bcs/index.js';import{normalizeWowAddress,WOW_ADDRESS_LENGTH}from'../utils/
|
|
1
|
+
import{fromBase64,toBase64}from'../_deps/bcs/index.js';import{blake2b}from'@noble/hashes/blake2b';import{bytesToHex}from'@noble/hashes/utils';import{bcs}from'../bcs/index.js';import{normalizeWowAddress,WOW_ADDRESS_LENGTH}from'../utils/wow-types.js';import{messageWithIntent}from'./intent.js';import{SIGNATURE_FLAG_TO_SCHEME,SIGNATURE_SCHEME_TO_SIZE}from'./signature-scheme.js';export function bytesEqual(c,d){if(c===d)return!![];if(c['length']!==d['length'])return![];for(let e=0x0;e<c['length'];e++){if(c[e]!==d[e])return![];}return!![];}export class PublicKey{['equals'](a){return bytesEqual(this['toRawBytes'](),a['toRawBytes']());}['toBase64'](){return toBase64(this['toRawBytes']());}['toString'](){throw new Error('`toString`\x20is\x20not\x20implemented\x20on\x20public\x20keys.\x20Use\x20`toBase64()`\x20or\x20`toRawBytes()`\x20instead.');}['toWPublicKey'](){const a=this['toWBytes']();return toBase64(a);}['verifyWithIntent'](a,b,c){const d=messageWithIntent(c,a),e=blake2b(d,{'dkLen':0x20});return this['verify'](e,b);}['verifyPersonalMessage'](a,b){return this['verifyWithIntent'](bcs['byteVector']()['serialize'](a)['toBytes'](),b,'PersonalMessage');}['verifyTransaction'](a,b){return this['verifyWithIntent'](a,b,'TransactionData');}['verifyAddress'](a){return this['toWAddress']()===a;}['toWBytes'](){const a=this['toRawBytes'](),b=new Uint8Array(a['length']+0x1);return b['set']([this['flag']()]),b['set'](a,0x1),b;}['toWAddress'](){return normalizeWowAddress(bytesToHex(blake2b(this['toWBytes'](),{'dkLen':0x20}))['slice'](0x0,WOW_ADDRESS_LENGTH*0x2));}}export function parseSerializedKeypairSignature(a){const b=fromBase64(a),c=SIGNATURE_FLAG_TO_SCHEME[b[0x0]];switch(c){case'MultiSig':case'Falcon512':const d=SIGNATURE_SCHEME_TO_SIZE[c],e=b['slice'](0x1,b['length']-d),f=b['slice'](0x1+e['length']);return{'serializedSignature':a,'signatureScheme':c,'signature':e,'publicKey':f,'bytes':b};default:throw new Error('Unsupported\x20signature\x20scheme');}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Simplify, UnionToIntersection } from "../_deps/utils/index.js";
|
|
2
2
|
import { ClientCache } from "./cache.js";
|
|
3
3
|
import type { Experimental_CoreClient } from "./core.js";
|
|
4
|
-
import type { ClientWithExtensions,
|
|
4
|
+
import type { ClientWithExtensions, Experimental_WowClientTypes, WowClientRegistration } from "./types.js";
|
|
5
5
|
export declare abstract class Experimental_BaseClient {
|
|
6
|
-
network:
|
|
6
|
+
network: Experimental_WowClientTypes.Network;
|
|
7
7
|
cache: ClientCache;
|
|
8
8
|
base: Experimental_BaseClient;
|
|
9
|
-
constructor({ network, base, cache, }:
|
|
9
|
+
constructor({ network, base, cache, }: Experimental_WowClientTypes.WowClientOptions);
|
|
10
10
|
abstract core: Experimental_CoreClient;
|
|
11
|
-
$extend<const Registrations extends
|
|
11
|
+
$extend<const Registrations extends WowClientRegistration<this>[]>(...registrations: Registrations): ClientWithExtensions<Simplify<UnionToIntersection<{ [K in keyof Registrations]: Registrations[K] extends WowClientRegistration<this, infer Name extends string, infer Extension> ? { [K2 in Name]: Extension; } : never; }[number]>>, this>;
|
|
12
12
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import type { TransactionPlugin } from "../transactions/index.js";
|
|
2
2
|
import { Experimental_BaseClient } from "./client.js";
|
|
3
|
-
import type { ClientWithExtensions,
|
|
3
|
+
import type { ClientWithExtensions, Experimental_WowClientTypes } from "./types.js";
|
|
4
4
|
export type ClientWithCoreApi = ClientWithExtensions<{
|
|
5
5
|
core: Experimental_CoreClient;
|
|
6
6
|
}>;
|
|
7
|
-
export interface Experimental_CoreClientOptions extends
|
|
7
|
+
export interface Experimental_CoreClientOptions extends Experimental_WowClientTypes.WowClientOptions {
|
|
8
8
|
base: Experimental_BaseClient;
|
|
9
9
|
}
|
|
10
|
-
export declare abstract class Experimental_CoreClient extends Experimental_BaseClient implements
|
|
10
|
+
export declare abstract class Experimental_CoreClient extends Experimental_BaseClient implements Experimental_WowClientTypes.TransportMethods {
|
|
11
11
|
core: this;
|
|
12
12
|
constructor(options: Experimental_CoreClientOptions);
|
|
13
|
-
abstract getObjects(options:
|
|
14
|
-
getObject(options:
|
|
15
|
-
abstract getCoins(options:
|
|
16
|
-
abstract getOwnedObjects(options:
|
|
17
|
-
abstract getBalance(options:
|
|
18
|
-
abstract getAllBalances(options:
|
|
19
|
-
abstract getTransaction(options:
|
|
20
|
-
abstract executeTransaction(options:
|
|
21
|
-
abstract dryRunTransaction(options:
|
|
22
|
-
abstract getReferenceGasPrice(options?:
|
|
23
|
-
abstract getDynamicFields(options:
|
|
13
|
+
abstract getObjects(options: Experimental_WowClientTypes.GetObjectsOptions): Promise<Experimental_WowClientTypes.GetObjectsResponse>;
|
|
14
|
+
getObject(options: Experimental_WowClientTypes.GetObjectOptions): Promise<Experimental_WowClientTypes.GetObjectResponse>;
|
|
15
|
+
abstract getCoins(options: Experimental_WowClientTypes.GetCoinsOptions): Promise<Experimental_WowClientTypes.GetCoinsResponse>;
|
|
16
|
+
abstract getOwnedObjects(options: Experimental_WowClientTypes.GetOwnedObjectsOptions): Promise<Experimental_WowClientTypes.GetOwnedObjectsResponse>;
|
|
17
|
+
abstract getBalance(options: Experimental_WowClientTypes.GetBalanceOptions): Promise<Experimental_WowClientTypes.GetBalanceResponse>;
|
|
18
|
+
abstract getAllBalances(options: Experimental_WowClientTypes.GetAllBalancesOptions): Promise<Experimental_WowClientTypes.GetAllBalancesResponse>;
|
|
19
|
+
abstract getTransaction(options: Experimental_WowClientTypes.GetTransactionOptions): Promise<Experimental_WowClientTypes.GetTransactionResponse>;
|
|
20
|
+
abstract executeTransaction(options: Experimental_WowClientTypes.ExecuteTransactionOptions): Promise<Experimental_WowClientTypes.ExecuteTransactionResponse>;
|
|
21
|
+
abstract dryRunTransaction(options: Experimental_WowClientTypes.DryRunTransactionOptions): Promise<Experimental_WowClientTypes.DryRunTransactionResponse>;
|
|
22
|
+
abstract getReferenceGasPrice(options?: Experimental_WowClientTypes.GetReferenceGasPriceOptions): Promise<Experimental_WowClientTypes.GetReferenceGasPriceResponse>;
|
|
23
|
+
abstract getDynamicFields(options: Experimental_WowClientTypes.GetDynamicFieldsOptions): Promise<Experimental_WowClientTypes.GetDynamicFieldsResponse>;
|
|
24
24
|
abstract resolveTransactionPlugin(): TransactionPlugin;
|
|
25
|
-
abstract getMoveFunction(options:
|
|
26
|
-
getDynamicField(options:
|
|
25
|
+
abstract getMoveFunction(options: Experimental_WowClientTypes.GetMoveFunctionOptions): Promise<Experimental_WowClientTypes.GetMoveFunctionResponse>;
|
|
26
|
+
getDynamicField(options: Experimental_WowClientTypes.GetDynamicFieldOptions): Promise<Experimental_WowClientTypes.GetDynamicFieldResponse>;
|
|
27
27
|
waitForTransaction({ signal, timeout, ...input }: {
|
|
28
28
|
signal?: AbortSignal;
|
|
29
29
|
timeout?: number;
|
|
30
|
-
} &
|
|
30
|
+
} & Experimental_WowClientTypes.GetTransactionOptions): Promise<Experimental_WowClientTypes.GetTransactionResponse>;
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TypeTagSerializer}from'../bcs/type-tag-serializer.js';import{deriveDynamicFieldID}from'../utils/dynamic-fields.js';import{normalizeStructTag,parseStructTag,WOW_ADDRESS_LENGTH}from'../utils/
|
|
1
|
+
import{TypeTagSerializer}from'../bcs/type-tag-serializer.js';import{deriveDynamicFieldID}from'../utils/dynamic-fields.js';import{normalizeStructTag,parseStructTag,WOW_ADDRESS_LENGTH}from'../utils/wow-types.js';import{Experimental_BaseClient}from'./client.js';export class Experimental_CoreClient extends Experimental_BaseClient{['core']=this;constructor(a){super(a);}async['getObject'](a){const {objectId:b}=a,{objects:[c]}=await this['getObjects']({'objectIds':[b],'signal':a['signal']});if(c instanceof Error)throw c;return{'object':c};}async['getDynamicField'](a){const b=TypeTagSerializer['parseFromStr'](a['name']['type']),c=deriveDynamicFieldID(a['parentId'],b,a['name']['bcs']),{objects:[d]}=await this['getObjects']({'objectIds':[c],'signal':a['signal']});if(d instanceof Error)throw d;const e=parseStructTag(d['type']),f=await d['content'];return{'dynamicField':{'id':d['id'],'digest':d['digest'],'version':d['version'],'type':d['type'],'previousTransaction':d['previousTransaction'],'name':{'type':typeof e['typeParams'][0x0]==='string'?e['typeParams'][0x0]:normalizeStructTag(e['typeParams'][0x0]),'bcs':a['name']['bcs']},'value':{'type':typeof e['typeParams'][0x1]==='string'?e['typeParams'][0x1]:normalizeStructTag(e['typeParams'][0x1]),'bcs':f['slice'](WOW_ADDRESS_LENGTH+a['name']['bcs']['length'])}}};}async['waitForTransaction']({signal:a,timeout:timeout=0x3c*0x3e8,...b}){const c=a?AbortSignal['any']([AbortSignal['timeout'](timeout),a]):AbortSignal['timeout'](timeout),d=new Promise((e,f)=>{c['addEventListener']('abort',()=>f(c['reason']));});d['catch'](()=>{});while(!![]){c['throwIfAborted']();try{return await this['getTransaction']({...b,'signal':c});}catch{await Promise['race']([new Promise(e=>setTimeout(e,0x7d0)),d]);}}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ObjectResponseError } from "../client/index.js";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class WowClientError extends Error {
|
|
3
3
|
}
|
|
4
|
-
export declare class ObjectError extends
|
|
4
|
+
export declare class ObjectError extends WowClientError {
|
|
5
5
|
code: string;
|
|
6
6
|
constructor(code: string, message: string);
|
|
7
7
|
static fromResponse(response: ObjectResponseError, objectId?: string): ObjectError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class WowClientError extends Error{}export class ObjectError extends WowClientError{['code'];constructor(a,b){super(b),this['code']=a;}static['fromResponse'](a,b){switch(a['code']){case'notExists':return new ObjectError(a['code'],'Object\x20'+a['object_id']+'\x20does\x20not\x20exist');case'dynamicFieldNotFound':return new ObjectError(a['code'],'Dynamic\x20field\x20not\x20found\x20for\x20object\x20'+a['parent_object_id']);case'deleted':return new ObjectError(a['code'],'Object\x20'+a['object_id']+'\x20has\x20been\x20deleted');case'displayError':return new ObjectError(a['code'],'Display\x20error:\x20'+a['error']);case'unknown':default:return new ObjectError(a['code'],'Unknown\x20error\x20while\x20loading\x20object'+(b?'\x20'+b:''));}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Experimental_BaseClient } from "./client.js";
|
|
2
2
|
import type { ClientWithCoreApi, Experimental_CoreClientOptions } from "./core.js";
|
|
3
3
|
import { Experimental_CoreClient } from "./core.js";
|
|
4
|
-
import type { ClientWithExtensions,
|
|
4
|
+
import type { ClientWithExtensions, Experimental_WowClientTypes, WowClientRegistration } from "./types.js";
|
|
5
5
|
export { parseTransactionBcs, parseTransactionEffectsBcs, } from "./transports/utils.js";
|
|
6
|
-
export { Experimental_BaseClient, Experimental_CoreClient, type Experimental_CoreClientOptions, type ClientWithExtensions, type
|
|
6
|
+
export { Experimental_BaseClient, Experimental_CoreClient, type Experimental_CoreClientOptions, type ClientWithExtensions, type Experimental_WowClientTypes, type WowClientRegistration, type ClientWithCoreApi, };
|
|
7
7
|
export { ClientCache, type ClientCacheOptions } from "./cache.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function parseTransactionBcs(bytes: Uint8Array):
|
|
3
|
-
export declare function parseTransactionEffectsBcs(effects: Uint8Array):
|
|
1
|
+
import type { Experimental_WowClientTypes } from "../types.js";
|
|
2
|
+
export declare function parseTransactionBcs(bytes: Uint8Array): Experimental_WowClientTypes.TransactionResponse["transaction"];
|
|
3
|
+
export declare function parseTransactionEffectsBcs(effects: Uint8Array): Experimental_WowClientTypes.TransactionEffects;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { SerializedTransactionDataV2, TransactionPlugin } from "../transactions/index.js";
|
|
2
2
|
import type { ClientCache } from "./cache.js";
|
|
3
3
|
import type { Experimental_BaseClient } from "./client.js";
|
|
4
|
-
export type
|
|
4
|
+
export type WowClientRegistration<T extends Experimental_BaseClient = Experimental_BaseClient, Name extends string = string, Extension = unknown> = {
|
|
5
5
|
readonly name: Name;
|
|
6
6
|
readonly register: (client: T) => Extension;
|
|
7
7
|
};
|
|
8
8
|
export type ClientWithExtensions<T, Base extends Experimental_BaseClient = Experimental_BaseClient> = Base & T;
|
|
9
|
-
export declare namespace
|
|
9
|
+
export declare namespace Experimental_WowClientTypes {
|
|
10
10
|
type Network = "mainnet" | "testnet" | "devnet" | "localnet" | (string & {});
|
|
11
|
-
interface
|
|
11
|
+
interface WowClientOptions {
|
|
12
12
|
network: Network;
|
|
13
13
|
base?: Experimental_BaseClient;
|
|
14
14
|
cache?: ClientCache;
|
|
@@ -33,17 +33,17 @@ type FaucetFailure = {
|
|
|
33
33
|
internal: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
export declare function
|
|
36
|
+
export declare function requestWowFromFaucetV0(input: {
|
|
37
37
|
host: string;
|
|
38
38
|
recipient: string;
|
|
39
39
|
headers?: HeadersInit;
|
|
40
40
|
}): Promise<FaucetResponse>;
|
|
41
|
-
export declare function
|
|
41
|
+
export declare function requestWowFromFaucetV1(input: {
|
|
42
42
|
host: string;
|
|
43
43
|
recipient: string;
|
|
44
44
|
headers?: HeadersInit;
|
|
45
45
|
}): Promise<BatchFaucetResponse>;
|
|
46
|
-
export declare function
|
|
46
|
+
export declare function requestWowFromFaucetV2(input: {
|
|
47
47
|
host: string;
|
|
48
48
|
recipient: string;
|
|
49
49
|
headers?: HeadersInit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class FaucetRateLimitError extends Error{}async function faucetRequest({host:a,path:b,body:c,headers:d,method:f}){const g=new URL(b,a)['toString'](),h={'Content-Type':'application/json'};d&&Object['assign'](h,d);const i=await fetch(g,{'method':f,'body':c?JSON['stringify'](c):undefined,'headers':h});if(i['status']===0x1ad)throw new FaucetRateLimitError('Too\x20many\x20requests\x20from\x20this\x20client\x20have\x20been\x20sent\x20to\x20the\x20faucet.\x20Please\x20retry\x20later');try{const j=await i['json']();return j;}catch(k){throw new Error('Encountered\x20error\x20when\x20parsing\x20response\x20from\x20faucet,\x20error:\x20'+k+',\x20status\x20'+i['status']+',\x20response\x20'+i);}}export async function
|
|
1
|
+
export class FaucetRateLimitError extends Error{}async function faucetRequest({host:a,path:b,body:c,headers:d,method:f}){const g=new URL(b,a)['toString'](),h={'Content-Type':'application/json'};d&&Object['assign'](h,d);const i=await fetch(g,{'method':f,'body':c?JSON['stringify'](c):undefined,'headers':h});if(i['status']===0x1ad)throw new FaucetRateLimitError('Too\x20many\x20requests\x20from\x20this\x20client\x20have\x20been\x20sent\x20to\x20the\x20faucet.\x20Please\x20retry\x20later');try{const j=await i['json']();return j;}catch(k){throw new Error('Encountered\x20error\x20when\x20parsing\x20response\x20from\x20faucet,\x20error:\x20'+k+',\x20status\x20'+i['status']+',\x20response\x20'+i);}}export async function requestWowFromFaucetV0(a){const b=await faucetRequest({'host':a['host'],'path':'/gas','body':{'FixedAmountRequest':{'recipient':a['recipient']}},'headers':a['headers'],'method':'POST'});if(b['error'])throw new Error('Faucet\x20request\x20failed:\x20'+b['error']);return b;}export async function requestWowFromFaucetV1(a){const b=await faucetRequest({'host':a['host'],'path':'/v1/gas','body':{'FixedAmountRequest':{'recipient':a['recipient']}},'headers':a['headers'],'method':'POST'});if(b['error'])throw new Error('Faucet\x20request\x20failed:\x20'+b['error']);return b;}export async function requestWowFromFaucetV2(a){const b=await faucetRequest({'host':a['host'],'path':'/v2/gas','body':{'FixedAmountRequest':{'recipient':a['recipient']}},'headers':a['headers'],'method':'POST'});if(b['status']!=='Success')throw new Error('Faucet\x20request\x20failed:\x20'+b['status']['Failure']['internal']);return b;}export async function getFaucetRequestStatus(a){const b=await faucetRequest({'host':a['host'],'path':'/v1/status/'+a['taskId'],'headers':a['headers'],'method':'GET'});if(b['error'])throw new Error('Faucet\x20request\x20failed:\x20'+b['error']);return b;}export function getFaucetHost(a){switch(a){case'testnet':return'https://faucet.testnet.wowok.net';case'localnet':return'http://127.0.0.1:9123';default:throw new Error('Unknown\x20network:\x20'+a);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { requestWowFromFaucetV0, requestWowFromFaucetV1, requestWowFromFaucetV2, getFaucetRequestStatus, getFaucetHost, FaucetRateLimitError, } from "./faucet.js";
|
package/dist/cjs/faucet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{requestWowFromFaucetV0,requestWowFromFaucetV1,requestWowFromFaucetV2,getFaucetRequestStatus,getFaucetHost,FaucetRateLimitError}from'./faucet.js';
|
|
@@ -7,17 +7,17 @@ import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
|
7
7
|
import { StateServiceClient } from "./proto/sui/rpc/v2/state_service.client.js";
|
|
8
8
|
import { SubscriptionServiceClient } from "./proto/sui/rpc/v2/subscription_service.client.js";
|
|
9
9
|
import { GrpcCoreClient } from "./core.js";
|
|
10
|
-
import type {
|
|
10
|
+
import type { Experimental_WowClientTypes } from "../experimental/index.js";
|
|
11
11
|
import { Experimental_BaseClient } from "../experimental/index.js";
|
|
12
|
-
interface
|
|
12
|
+
interface WowGrpcTransportOptions extends GrpcWebOptions {
|
|
13
13
|
transport?: never;
|
|
14
14
|
}
|
|
15
|
-
export type
|
|
16
|
-
network:
|
|
15
|
+
export type WowGrpcClientOptions = {
|
|
16
|
+
network: Experimental_WowClientTypes.Network;
|
|
17
17
|
} & ({
|
|
18
18
|
transport: RpcTransport;
|
|
19
|
-
} |
|
|
20
|
-
export declare class
|
|
19
|
+
} | WowGrpcTransportOptions);
|
|
20
|
+
export declare class WowGrpcClient extends Experimental_BaseClient {
|
|
21
21
|
core: GrpcCoreClient;
|
|
22
22
|
transactionExecutionService: TransactionExecutionServiceClient;
|
|
23
23
|
ledgerService: LedgerServiceClient;
|
|
@@ -25,6 +25,6 @@ export declare class SuiGrpcClient extends Experimental_BaseClient {
|
|
|
25
25
|
subscriptionService: SubscriptionServiceClient;
|
|
26
26
|
movePackageService: MovePackageServiceClient;
|
|
27
27
|
signatureVerificationService: SignatureVerificationServiceClient;
|
|
28
|
-
constructor(options:
|
|
28
|
+
constructor(options: WowGrpcClientOptions);
|
|
29
29
|
}
|
|
30
30
|
export {};
|
package/dist/cjs/grpc/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GrpcWebFetchTransport}from'@protobuf-ts/grpcweb-transport';import{TransactionExecutionServiceClient}from'./proto/sui/rpc/v2/transaction_execution_service.client.js';import{LedgerServiceClient}from'./proto/sui/rpc/v2/ledger_service.client.js';import{MovePackageServiceClient}from'./proto/sui/rpc/v2/move_package_service.client.js';import{SignatureVerificationServiceClient}from'./proto/sui/rpc/v2/signature_verification_service.client.js';import{StateServiceClient}from'./proto/sui/rpc/v2/state_service.client.js';import{SubscriptionServiceClient}from'./proto/sui/rpc/v2/subscription_service.client.js';import{GrpcCoreClient}from'./core.js';import{Experimental_BaseClient}from'../experimental/index.js';export class
|
|
1
|
+
import{GrpcWebFetchTransport}from'@protobuf-ts/grpcweb-transport';import{TransactionExecutionServiceClient}from'./proto/sui/rpc/v2/transaction_execution_service.client.js';import{LedgerServiceClient}from'./proto/sui/rpc/v2/ledger_service.client.js';import{MovePackageServiceClient}from'./proto/sui/rpc/v2/move_package_service.client.js';import{SignatureVerificationServiceClient}from'./proto/sui/rpc/v2/signature_verification_service.client.js';import{StateServiceClient}from'./proto/sui/rpc/v2/state_service.client.js';import{SubscriptionServiceClient}from'./proto/sui/rpc/v2/subscription_service.client.js';import{GrpcCoreClient}from'./core.js';import{Experimental_BaseClient}from'../experimental/index.js';export class WowGrpcClient extends Experimental_BaseClient{['core'];['transactionExecutionService'];['ledgerService'];['stateService'];['subscriptionService'];['movePackageService'];['signatureVerificationService'];constructor(a){super({'network':a['network']});const b=a['transport']??new GrpcWebFetchTransport({'baseUrl':a['baseUrl'],'fetchInit':a['fetchInit']});this['transactionExecutionService']=new TransactionExecutionServiceClient(b),this['ledgerService']=new LedgerServiceClient(b),this['stateService']=new StateServiceClient(b),this['subscriptionService']=new SubscriptionServiceClient(b),this['movePackageService']=new MovePackageServiceClient(b),this['signatureVerificationService']=new SignatureVerificationServiceClient(b),this['core']=new GrpcCoreClient({'client':this,'base':this,'network':a['network']});}}
|
package/dist/cjs/grpc/core.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { Experimental_CoreClientOptions,
|
|
1
|
+
import type { Experimental_CoreClientOptions, Experimental_WowClientTypes } from "../experimental/index.js";
|
|
2
2
|
import { Experimental_CoreClient } from "../experimental/index.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WowGrpcClient } from "./client.js";
|
|
4
4
|
import type { TransactionEffects } from "./proto/sui/rpc/v2/effects.js";
|
|
5
5
|
import type { BuildTransactionOptions } from "../transactions/index.js";
|
|
6
6
|
import { TransactionDataBuilder } from "../transactions/index.js";
|
|
7
7
|
export interface GrpcCoreClientOptions extends Experimental_CoreClientOptions {
|
|
8
|
-
client:
|
|
8
|
+
client: WowGrpcClient;
|
|
9
9
|
}
|
|
10
10
|
export declare class GrpcCoreClient extends Experimental_CoreClient {
|
|
11
11
|
#private;
|
|
12
12
|
constructor({ client, ...options }: GrpcCoreClientOptions);
|
|
13
|
-
getObjects(options:
|
|
14
|
-
getOwnedObjects(options:
|
|
15
|
-
getCoins(options:
|
|
16
|
-
getBalance(options:
|
|
17
|
-
getAllBalances(options:
|
|
18
|
-
getTransaction(options:
|
|
19
|
-
executeTransaction(options:
|
|
20
|
-
dryRunTransaction(options:
|
|
21
|
-
getReferenceGasPrice(): Promise<
|
|
22
|
-
getDynamicFields(options:
|
|
23
|
-
getMoveFunction(options:
|
|
13
|
+
getObjects(options: Experimental_WowClientTypes.GetObjectsOptions): Promise<Experimental_WowClientTypes.GetObjectsResponse>;
|
|
14
|
+
getOwnedObjects(options: Experimental_WowClientTypes.GetOwnedObjectsOptions): Promise<Experimental_WowClientTypes.GetOwnedObjectsResponse>;
|
|
15
|
+
getCoins(options: Experimental_WowClientTypes.GetCoinsOptions): Promise<Experimental_WowClientTypes.GetCoinsResponse>;
|
|
16
|
+
getBalance(options: Experimental_WowClientTypes.GetBalanceOptions): Promise<Experimental_WowClientTypes.GetBalanceResponse>;
|
|
17
|
+
getAllBalances(options: Experimental_WowClientTypes.GetAllBalancesOptions): Promise<Experimental_WowClientTypes.GetAllBalancesResponse>;
|
|
18
|
+
getTransaction(options: Experimental_WowClientTypes.GetTransactionOptions): Promise<Experimental_WowClientTypes.GetTransactionResponse>;
|
|
19
|
+
executeTransaction(options: Experimental_WowClientTypes.ExecuteTransactionOptions): Promise<Experimental_WowClientTypes.ExecuteTransactionResponse>;
|
|
20
|
+
dryRunTransaction(options: Experimental_WowClientTypes.DryRunTransactionOptions): Promise<Experimental_WowClientTypes.DryRunTransactionResponse>;
|
|
21
|
+
getReferenceGasPrice(): Promise<Experimental_WowClientTypes.GetReferenceGasPriceResponse>;
|
|
22
|
+
getDynamicFields(options: Experimental_WowClientTypes.GetDynamicFieldsOptions): Promise<Experimental_WowClientTypes.GetDynamicFieldsResponse>;
|
|
23
|
+
getMoveFunction(options: Experimental_WowClientTypes.GetMoveFunctionOptions): Promise<Experimental_WowClientTypes.GetMoveFunctionResponse>;
|
|
24
24
|
resolveTransactionPlugin(): (_transactionData: TransactionDataBuilder, _options: BuildTransactionOptions, _next: () => Promise<void>) => Promise<never>;
|
|
25
25
|
}
|
|
26
26
|
export declare function parseTransactionEffects({ effects, }: {
|
|
27
27
|
effects: TransactionEffects | undefined;
|
|
28
|
-
}):
|
|
28
|
+
}): Experimental_WowClientTypes.TransactionEffects | null;
|