@r3e/neo-js-sdk 0.3.2 → 0.3.3

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { ADDRESS_VERSION, CRYPTOLIB_CONTRACT_HASH, GAS_CONTRACT_HASH, LEDGER_CONTRACT_HASH, MAIN_NETWORK_ID, NEO_CONTRACT_HASH, NOTARY_CONTRACT_HASH, ORACLE_CONTRACT_HASH, POLICY_CONTRACT_HASH, ROLE_MANAGEMENT_CONTRACT_HASH, STDLIB_CONTRACT_HASH, TEST_NETWORK_ID, addressVersion, cryptolibContractHash, gasContractHash, ledgerContractHash, mainNetworkId, neoContractHash, notaryContractHash, oracleContractHash, policyContractHash, roleManagementContractHash, stdlibContractHash, testNetworkId } from "./constants.js";
2
- export { base64ToBytes, bytesToBase64, bytesToHex, hexToBytes, reverseBytes, utf8ToBytes } from "./internal/bytes.js";
1
+ export { ADDRESS_VERSION, CRYPTOLIB_CONTRACT_HASH, GAS_CONTRACT_HASH, LEDGER_CONTRACT_HASH, MAIN_NETWORK_ID, NEO_CONTRACT_HASH, NOTARY_CONTRACT_HASH, ORACLE_CONTRACT_HASH, POLICY_CONTRACT_HASH, ROLE_MANAGEMENT_CONTRACT_HASH, STDLIB_CONTRACT_HASH, TEST_NETWORK_ID, addressVersion, cryptolibContractHash, gasContractHash, ledgerContractHash, mainNetworkId, neoContractHash, notaryContractHash, oracleContractHash, policyContractHash, roleManagementContractHash, stdlibContractHash, testNetworkId, } from "./constants.js";
2
+ export { base64ToBytes, bytesToBase64, bytesToHex, hexToBytes, reverseBytes, utf8ToBytes, hex2base64, base642hex, } from "./internal/bytes.js";
3
3
  export { H160, H256 } from "./core/hash.js";
4
4
  export { BinaryReader, BinaryWriter, deserialize, serialize } from "./core/serializing.js";
5
5
  export { Block, Header, TrimmedBlock } from "./core/block.js";
@@ -7,10 +7,10 @@ export { PrivateKey, PublicKey } from "./core/keypair.js";
7
7
  export { CallFlags, ScriptBuilder, syscallCode } from "./core/script.js";
8
8
  export { OpCode } from "./core/opcode.js";
9
9
  export { Witness, WitnessScope, witnessScopeName } from "./core/witness.js";
10
- export { AndCondition, type AndConditionJson, type BaseWitnessConditionJson, type BooleanConditionJson, BooleanCondition, CalledByContractCondition, type CalledByContractConditionJson, CalledByEntryCondition, type CalledByEntryConditionJson, CalledByGroupCondition, type CalledByGroupConditionJson, GroupCondition, type GroupConditionJson, NotCondition, type NotConditionJson, OrCondition, type OrConditionJson, ScriptHashCondition, type ScriptHashConditionJson, WitnessCondition, type WitnessConditionJson, WitnessConditionType, WitnessRule, type WitnessRuleJson, WitnessRuleAction } from "./core/witness-rule.js";
11
- export { type BaseTxAttributeJson, type ConflictsAttributeJson, ConflictsAttribute, type HighPriorityAttributeJson, HighPriorityAttribute, type NotaryAssistedAttributeJson, NotValidBeforeAttribute, type NotValidBeforeAttributeJson, NotaryAssistedAttribute, type OracleResponseAttributeJson, OracleResponseAttribute, OracleResponseCode, Signer, type SignerJson, Tx, TxAttribute, type TxAttributeJson, TxAttributeType } from "./core/tx.js";
12
- export { InvokeParameters, JsonRpc, JsonRpcError, RpcClient, RpcCode, mainnetEndpoints, testnetEndpoints } from "./rpcclient/index.js";
13
- export { buildStackParser, parseInvokeStack, parseStackItemArray, parseStackItemBoolean, parseStackItemBytes, parseStackItemInteger, parseStackItemMap, parseStackItemStruct, parseStackItemUtf8 } from "./rpcclient/parse.js";
14
- export type { ApplicationLogExecution, ApplicationLogInvocation, CalculateNetworkFeeInput, CancelTransactionResult, CancelTransactionInput, CloseWalletResult, DumpPrivKeyInput, DumpPrivKeyResult, FindStatesInput, FindStatesResult, FindStorageEntry, FindStorageInput, FindStorageResult, GetApplicationLogInput, GetApplicationLogResult, GetBlockHashInput, GetBlockHeaderInput, GetBlockHeaderCountResult, GetBlockHeaderVerboseResult, GetBlockInput, GetBlockVerboseResult, GetCandidatesResult, GetConnectionCountResult, GetContractStateInput, GetContractStateManifestAbiResult, GetContractStateManifestEventResult, GetContractStateManifestGroupResult, GetContractStateManifestMethodResult, GetContractStateManifestParameterResult, GetContractStateManifestPermissionResult, GetContractStateManifestResult, GetContractStateNefMethodTokenResult, GetContractStateNefResult, GetContractStateResult, GetNativeContractsResult, GetNep11BalancesInput, GetNep11BalancesResult, GetNep11PropertiesInput, GetNep11PropertiesResult, GetNep11PropertyValueResult, GetNep11TransfersInput, GetNep11TransfersResult, GetNep17BalancesResult, GetNep17BalancesInput, GetNep17TransfersInput, GetNep17TransfersResult, GetNewAddressResult, GetPeersResult, GetProofInput, GetProofResult, GetRawMemPoolResult, GetRawMemPoolVerboseResult, GetRawTransactionInput, GetRawTransactionResult, GetStateInput, GetStateHeightResult, GetStateResult, GetStateRootInput, GetStateRootResult, GetStorageInput, GetStorageResult, GetTransactionHeightInput, GetUnclaimedGasInput, GetUnclaimedGasResult, GetUnspentsInput, GetUnspentsResult, GetVersionHardforkResult, GetVersionProtocolResult, GetVersionResult, GetVersionRpcSettingsResult, GetWalletBalanceInput, GetWalletUnclaimedGasResult, ImportPrivKeyInput, ImportPrivKeyResult, InvokeContractVerifyResult, InvokeContractVerifyInput, InvokeDiagnosticsInvocationTree, InvokeDiagnosticsResult, InvokeDiagnosticsStorageChange, InvokeFunctionInput, InvokeParametersLike, InvokeResult, InvokeScriptInput, ListAddressResult, ListPluginsResult, Nep11Balance, Nep11TokenBalance, Nep11TransferEvent, Nep17Balance, Nep17TransferEvent, NetworkFeeResult, NodePeer, OpenWalletResult, OpenWalletInput, PendingSignatureContextItem, PendingSignatureResult, RelayTransactionResult, RpcBinaryPayload, RpcAccountResult, RpcAnyStackItemJson, RpcArrayStackItemJson, RpcBaseStackItemJson, RpcBooleanStackItemJson, RpcBufferStackItemJson, RpcByteStringStackItemJson, RpcIntegerStackItemJson, RpcInteropInterfaceStackItemJson, RpcMapStackEntryJson, RpcMapStackItemJson, RpcNotification, RpcPlugin, RpcPointerStackItemJson, RpcSignerJson, RpcSignerInput, RpcStackItemJson, RpcStructStackItemJson, RpcValidatorResult, RpcWitnessJson, SendFromInput, SendManyInput, SendManyTransferInput, SendRawTransactionResult, SendRawTransactionInput, SendToAddressInput, SubmitBlockResult, SubmitBlockInput, TerminateSessionResult, TraverseIteratorInput, TransactionJsonResult, TraverseIteratorResult, UnspentBalance, UnspentTransaction, ValidateAddressInput, ValidateAddressResult, VerifyProofInput, WalletBalanceResult } from "./rpcclient/types.js";
15
- export { Account, Contract, Parameter, ScryptParams, Wallet, decryptSecp256r1Key, encryptSecp256r1Key } from "./wallet/index.js";
10
+ export { AndCondition, type AndConditionJson, type BaseWitnessConditionJson, type BooleanConditionJson, BooleanCondition, CalledByContractCondition, type CalledByContractConditionJson, CalledByEntryCondition, type CalledByEntryConditionJson, CalledByGroupCondition, type CalledByGroupConditionJson, GroupCondition, type GroupConditionJson, NotCondition, type NotConditionJson, OrCondition, type OrConditionJson, ScriptHashCondition, type ScriptHashConditionJson, WitnessCondition, type WitnessConditionJson, WitnessConditionType, WitnessRule, type WitnessRuleJson, WitnessRuleAction, } from "./core/witness-rule.js";
11
+ export { type BaseTxAttributeJson, type ConflictsAttributeJson, ConflictsAttribute, type HighPriorityAttributeJson, HighPriorityAttribute, type NotaryAssistedAttributeJson, NotValidBeforeAttribute, type NotValidBeforeAttributeJson, NotaryAssistedAttribute, type OracleResponseAttributeJson, OracleResponseAttribute, OracleResponseCode, Signer, type SignerJson, Tx, TxAttribute, type TxAttributeJson, TxAttributeType, } from "./core/tx.js";
12
+ export { InvokeParameters, JsonRpc, JsonRpcError, RpcClient, RpcCode, mainnetEndpoints, testnetEndpoints, } from "./rpcclient/index.js";
13
+ export { buildStackParser, parseInvokeStack, parseStackItemArray, parseStackItemBoolean, parseStackItemBytes, parseStackItemInteger, parseStackItemMap, parseStackItemStruct, parseStackItemUtf8, } from "./rpcclient/parse.js";
14
+ export type { ApplicationLogExecution, ApplicationLogInvocation, CalculateNetworkFeeInput, CancelTransactionResult, CancelTransactionInput, CloseWalletResult, DumpPrivKeyInput, DumpPrivKeyResult, FindStatesInput, FindStatesResult, FindStorageEntry, FindStorageInput, FindStorageResult, GetApplicationLogInput, GetApplicationLogResult, GetBlockHashInput, GetBlockHeaderInput, GetBlockHeaderCountResult, GetBlockHeaderVerboseResult, GetBlockInput, GetBlockVerboseResult, GetCandidatesResult, GetConnectionCountResult, GetContractStateInput, GetContractStateManifestAbiResult, GetContractStateManifestEventResult, GetContractStateManifestGroupResult, GetContractStateManifestMethodResult, GetContractStateManifestParameterResult, GetContractStateManifestPermissionResult, GetContractStateManifestResult, GetContractStateNefMethodTokenResult, GetContractStateNefResult, GetContractStateResult, GetNativeContractsResult, GetNep11BalancesInput, GetNep11BalancesResult, GetNep11PropertiesInput, GetNep11PropertiesResult, GetNep11PropertyValueResult, GetNep11TransfersInput, GetNep11TransfersResult, GetNep17BalancesResult, GetNep17BalancesInput, GetNep17TransfersInput, GetNep17TransfersResult, GetNewAddressResult, GetPeersResult, GetProofInput, GetProofResult, GetRawMemPoolResult, GetRawMemPoolVerboseResult, GetRawTransactionInput, GetRawTransactionResult, GetStateInput, GetStateHeightResult, GetStateResult, GetStateRootInput, GetStateRootResult, GetStorageInput, GetStorageResult, GetTransactionHeightInput, GetUnclaimedGasInput, GetUnclaimedGasResult, GetUnspentsInput, GetUnspentsResult, GetVersionHardforkResult, GetVersionProtocolResult, GetVersionResult, GetVersionRpcSettingsResult, GetWalletBalanceInput, GetWalletUnclaimedGasResult, ImportPrivKeyInput, ImportPrivKeyResult, InvokeContractVerifyResult, InvokeContractVerifyInput, InvokeDiagnosticsInvocationTree, InvokeDiagnosticsResult, InvokeDiagnosticsStorageChange, InvokeFunctionInput, InvokeParametersLike, InvokeResult, InvokeScriptInput, ListAddressResult, ListPluginsResult, Nep11Balance, Nep11TokenBalance, Nep11TransferEvent, Nep17Balance, Nep17TransferEvent, NetworkFeeResult, NodePeer, OpenWalletResult, OpenWalletInput, PendingSignatureContextItem, PendingSignatureResult, RelayTransactionResult, RpcBinaryPayload, RpcAccountResult, RpcAnyStackItemJson, RpcArrayStackItemJson, RpcBaseStackItemJson, RpcBooleanStackItemJson, RpcBufferStackItemJson, RpcByteStringStackItemJson, RpcIntegerStackItemJson, RpcInteropInterfaceStackItemJson, RpcMapStackEntryJson, RpcMapStackItemJson, RpcNotification, RpcPlugin, RpcPointerStackItemJson, RpcSignerJson, RpcSignerInput, RpcStackItemJson, RpcStructStackItemJson, RpcValidatorResult, RpcWitnessJson, SendFromInput, SendManyInput, SendManyTransferInput, SendRawTransactionResult, SendRawTransactionInput, SendToAddressInput, SubmitBlockResult, SubmitBlockInput, TerminateSessionResult, TraverseIteratorInput, TransactionJsonResult, TraverseIteratorResult, UnspentBalance, UnspentTransaction, ValidateAddressInput, ValidateAddressResult, VerifyProofInput, WalletBalanceResult, } from "./rpcclient/types.js";
15
+ export { Account, Contract, Parameter, ScryptParams, Wallet, decryptSecp256r1Key, encryptSecp256r1Key, } from "./wallet/index.js";
16
16
  export { hash160, hexstring2str, num2hexstring, reverseHex, str2hexstring } from "./utils.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { ADDRESS_VERSION, CRYPTOLIB_CONTRACT_HASH, GAS_CONTRACT_HASH, LEDGER_CONTRACT_HASH, MAIN_NETWORK_ID, NEO_CONTRACT_HASH, NOTARY_CONTRACT_HASH, ORACLE_CONTRACT_HASH, POLICY_CONTRACT_HASH, ROLE_MANAGEMENT_CONTRACT_HASH, STDLIB_CONTRACT_HASH, TEST_NETWORK_ID, addressVersion, cryptolibContractHash, gasContractHash, ledgerContractHash, mainNetworkId, neoContractHash, notaryContractHash, oracleContractHash, policyContractHash, roleManagementContractHash, stdlibContractHash, testNetworkId } from "./constants.js";
2
- export { base64ToBytes, bytesToBase64, bytesToHex, hexToBytes, reverseBytes, utf8ToBytes } from "./internal/bytes.js";
1
+ export { ADDRESS_VERSION, CRYPTOLIB_CONTRACT_HASH, GAS_CONTRACT_HASH, LEDGER_CONTRACT_HASH, MAIN_NETWORK_ID, NEO_CONTRACT_HASH, NOTARY_CONTRACT_HASH, ORACLE_CONTRACT_HASH, POLICY_CONTRACT_HASH, ROLE_MANAGEMENT_CONTRACT_HASH, STDLIB_CONTRACT_HASH, TEST_NETWORK_ID, addressVersion, cryptolibContractHash, gasContractHash, ledgerContractHash, mainNetworkId, neoContractHash, notaryContractHash, oracleContractHash, policyContractHash, roleManagementContractHash, stdlibContractHash, testNetworkId, } from "./constants.js";
2
+ export { base64ToBytes, bytesToBase64, bytesToHex, hexToBytes, reverseBytes, utf8ToBytes, hex2base64, base642hex, } from "./internal/bytes.js";
3
3
  export { H160, H256 } from "./core/hash.js";
4
4
  export { BinaryReader, BinaryWriter, deserialize, serialize } from "./core/serializing.js";
5
5
  export { Block, Header, TrimmedBlock } from "./core/block.js";
@@ -7,9 +7,9 @@ export { PrivateKey, PublicKey } from "./core/keypair.js";
7
7
  export { CallFlags, ScriptBuilder, syscallCode } from "./core/script.js";
8
8
  export { OpCode } from "./core/opcode.js";
9
9
  export { Witness, WitnessScope, witnessScopeName } from "./core/witness.js";
10
- export { AndCondition, BooleanCondition, CalledByContractCondition, CalledByEntryCondition, CalledByGroupCondition, GroupCondition, NotCondition, OrCondition, ScriptHashCondition, WitnessCondition, WitnessConditionType, WitnessRule, WitnessRuleAction } from "./core/witness-rule.js";
11
- export { ConflictsAttribute, HighPriorityAttribute, NotValidBeforeAttribute, NotaryAssistedAttribute, OracleResponseAttribute, OracleResponseCode, Signer, Tx, TxAttribute, TxAttributeType } from "./core/tx.js";
12
- export { InvokeParameters, JsonRpc, JsonRpcError, RpcClient, RpcCode, mainnetEndpoints, testnetEndpoints } from "./rpcclient/index.js";
13
- export { buildStackParser, parseInvokeStack, parseStackItemArray, parseStackItemBoolean, parseStackItemBytes, parseStackItemInteger, parseStackItemMap, parseStackItemStruct, parseStackItemUtf8 } from "./rpcclient/parse.js";
14
- export { Account, Contract, Parameter, ScryptParams, Wallet, decryptSecp256r1Key, encryptSecp256r1Key } from "./wallet/index.js";
10
+ export { AndCondition, BooleanCondition, CalledByContractCondition, CalledByEntryCondition, CalledByGroupCondition, GroupCondition, NotCondition, OrCondition, ScriptHashCondition, WitnessCondition, WitnessConditionType, WitnessRule, WitnessRuleAction, } from "./core/witness-rule.js";
11
+ export { ConflictsAttribute, HighPriorityAttribute, NotValidBeforeAttribute, NotaryAssistedAttribute, OracleResponseAttribute, OracleResponseCode, Signer, Tx, TxAttribute, TxAttributeType, } from "./core/tx.js";
12
+ export { InvokeParameters, JsonRpc, JsonRpcError, RpcClient, RpcCode, mainnetEndpoints, testnetEndpoints, } from "./rpcclient/index.js";
13
+ export { buildStackParser, parseInvokeStack, parseStackItemArray, parseStackItemBoolean, parseStackItemBytes, parseStackItemInteger, parseStackItemMap, parseStackItemStruct, parseStackItemUtf8, } from "./rpcclient/parse.js";
14
+ export { Account, Contract, Parameter, ScryptParams, Wallet, decryptSecp256r1Key, encryptSecp256r1Key, } from "./wallet/index.js";
15
15
  export { hash160, hexstring2str, num2hexstring, reverseHex, str2hexstring } from "./utils.js";
@@ -9,3 +9,13 @@ export declare function reverseBytes(value: BytesLike): Uint8Array;
9
9
  export declare function equalBytes(a: BytesLike, b: BytesLike): boolean;
10
10
  export declare function utf8ToBytes(value: string): Uint8Array;
11
11
  export declare function encodeUInt32LE(value: number): Uint8Array;
12
+ /**
13
+ * Convert hex string to base64 string
14
+ * Convenience function for common conversion pattern
15
+ */
16
+ export declare function hex2base64(hex: string): string;
17
+ /**
18
+ * Convert base64 string to hex string
19
+ * Convenience function for common conversion pattern
20
+ */
21
+ export declare function base642hex(base64: string): string;
@@ -53,3 +53,17 @@ export function encodeUInt32LE(value) {
53
53
  out[3] = (value >> 24) & 0xff;
54
54
  return out;
55
55
  }
56
+ /**
57
+ * Convert hex string to base64 string
58
+ * Convenience function for common conversion pattern
59
+ */
60
+ export function hex2base64(hex) {
61
+ return bytesToBase64(hexToBytes(hex));
62
+ }
63
+ /**
64
+ * Convert base64 string to hex string
65
+ * Convenience function for common conversion pattern
66
+ */
67
+ export function base642hex(base64) {
68
+ return bytesToHex(base64ToBytes(base64));
69
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r3e/neo-js-sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Neo N3 JavaScript/TypeScript SDK — successor to neo-js (no longer maintained). Typed models, object-based RPC inputs, full N3 RPC coverage.",
5
5
  "repository": {
6
6
  "type": "git",