@keetanetwork/keetanet-client 0.10.2 → 0.10.4
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/README.md +7 -0
- package/api/node.d.ts +2 -0
- package/client/builder.d.ts +42 -2
- package/client/client_common_tests.d.ts +6 -5
- package/client/index-browser.d.ts +908 -27
- package/client/index-browser.js +3075 -1723
- package/client/index.d.ts +908 -27
- package/client/index.js +85673 -83037
- package/config/index.d.ts +16 -0
- package/docs/assets/fonts/Surt-Expanded-Bold.woff2 +0 -0
- package/docs/assets/fonts/Surt-Expanded-Medium.woff2 +0 -0
- package/docs/assets/fonts/Surt-Expanded-Regular.woff2 +0 -0
- package/docs/assets/fonts/Surt-Expanded-Semibold.woff2 +0 -0
- package/docs/assets/fonts/Surt-Normal-Bold.woff2 +0 -0
- package/docs/assets/fonts/Surt-Normal-Medium.woff2 +0 -0
- package/docs/assets/fonts/Surt-Normal-Regular.woff2 +0 -0
- package/docs/assets/fonts/Surt-Normal-Semibold.woff2 +0 -0
- package/docs/assets/fonts/UbuntuMono-Regular.ttf +0 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/logo-keeta-dark.svg +14 -0
- package/docs/assets/logo-keeta-light.svg +14 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1640 -0
- package/docs/assets/typedoc-github-style.css +557 -0
- package/docs/classes/KeetaNetSDK.Client.html +288 -0
- package/docs/classes/KeetaNetSDK.Referenced.Account.html +107 -0
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.Block.html +36 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +26 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +18 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +6 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +10 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +10 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +11 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +11 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +30 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +33 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +34 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +28 -0
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +28 -0
- package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +16 -0
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +28 -0
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +5 -0
- package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +26 -0
- package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.Ledger.html +41 -0
- package/docs/classes/KeetaNetSDK.Referenced.LedgerAtomicInterface.html +27 -0
- package/docs/classes/KeetaNetSDK.Referenced.LedgerRequestCache.html +7 -0
- package/docs/classes/KeetaNetSDK.Referenced.Node.html +21 -0
- package/docs/classes/KeetaNetSDK.Referenced.P2PSwitch.html +40 -0
- package/docs/classes/KeetaNetSDK.Referenced.PendingAccount.html +5 -0
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +6 -0
- package/docs/classes/KeetaNetSDK.Referenced.Permissions.html +20 -0
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +26 -0
- package/docs/classes/KeetaNetSDK.Referenced.PublicKeyString.html +8 -0
- package/docs/classes/KeetaNetSDK.Referenced.RequestTiming.html +8 -0
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.Stats.html +13 -0
- package/docs/classes/KeetaNetSDK.Referenced.UserClientBuilder.html +29 -0
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +31 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +20 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHashMap.html +26 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +8 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +11 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +40 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +14 -0
- package/docs/classes/KeetaNetSDK.Referenced.default.html +9 -0
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.BufferStorageASN1.html +9 -0
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.html +19 -0
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +11 -0
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_certificate.Certificate.html +79 -0
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateBuilder.html +9 -0
- package/docs/classes/KeetaNetSDK.UserClient.html +254 -0
- package/docs/documents/GETTING-STARTED.html +268 -0
- package/docs/enums/KeetaNetSDK.Referenced.AccountKeyAlgorithm.html +9 -0
- package/docs/enums/KeetaNetSDK.Referenced.AdjustMethod.html +4 -0
- package/docs/enums/KeetaNetSDK.Referenced.BaseFlag.html +15 -0
- package/docs/enums/KeetaNetSDK.Referenced.BasePermissionGroup.html +9 -0
- package/docs/enums/KeetaNetSDK.Referenced.LedgerKind.html +4 -0
- package/docs/enums/KeetaNetSDK.Referenced.NodeKind.html +5 -0
- package/docs/enums/KeetaNetSDK.Referenced.OperationType.html +10 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getDefaultConfig.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getNetworkAlias.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getValidation.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_config.isNetwork.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_asn1.isValidSequenceSchema.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_bloom.deserializeBloomFilter.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_bloom.serializeBloomFilter.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.DecodeBase32.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.DecodeBase64.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.EncodeBase32.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.EncodeBase64.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.ZlibDeflate.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.ZlibInflate.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.RegisterSerializable.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.objectToBuffer.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.parseHexBigIntString.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.toJSONSerializable.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_hash.Hash.html +4 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.arrayRepeat.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.asleep.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.bufferToArrayBuffer.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.checkableGenerator.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.debugPrintableObject.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.env.html +3 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.internalLogger.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.isBuffer.html +6 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.isIntegerOrBigInt.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.objectToBuffer.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.promiseGenerator.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.randomInt.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.randomString.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.setGenerator.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.waitTicks.html +2 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_initial.generateInitialVoteStaple.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +10 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLRow.html +10 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +12 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.APIOptions.html +10 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.AccountInfo.html +12 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.AccountSignerOptions.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.AccountSignerOptionsJSON.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.AllPendingJSON.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseFlagRule.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockCanonical.html +10 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSON.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOutput.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockOperationValidateContext.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockUnsignedCanonical.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputeBlocksResponse.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlockEffect.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectFields.html +8 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectTokenChangesField.html +1 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +8 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.GetPeersAPIResponse.html +9 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.GetPeersOptions.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.GetRepresentativeAPIResponse.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.HTTPConfig.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.IdentifierCreateRequest.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.KVStorageProviderAPI.html +8 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerConfig.html +21 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStatistics.html +8 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageAPI.html +69 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.NodeConfig.html +32 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PConfig.html +24 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PConnection.html +27 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PSwitchStatistics.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PeerInfo.html +10 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperations.html +9 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperationsJSON.html +9 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PrincipalACLWithInfoParsed.html +24 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStringMapping.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.RenderOptions.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.RepresentativeInfo.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.StatsConfig.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.TextValidationRule.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +26 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientListenerTypes.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +16 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ValidationOptions.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSON.html +8 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSONOutput.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteStapleJSON.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.WithConversionClass.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.signOptionsType.html +9 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_config.ValidationConfig.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BitString.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Date.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1OID.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Set.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1String.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSet.html +10 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSetConstructor.html +2 -0
- package/docs/media/index-1.js +517 -0
- package/docs/media/index.js +82 -0
- package/docs/modules/KeetaNetSDK.Referenced.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_config.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_asn1.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_bloom.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_buffer.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_certificate.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_conversion.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_hash.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html +1 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_initial.html +1 -0
- package/docs/modules/KeetaNetSDK.html +8 -0
- package/docs/modules.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ACLEntryUnparsed.html +5 -0
- package/docs/types/KeetaNetSDK.Referenced.ASN1AnyASN.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AcceptedPermissionTypes.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountBalancesUnparsed.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountInfoResponse.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountOrPending.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountPrefix.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountPublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AllPending.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BaseFlagName.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BaseFlagNames.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BasePermissionOffsetSet.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BasicSchemaMap.html +14 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockJSONIncomplete.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockOperations.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlocksAlwaysReturn.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.BlocksWithAddSupply.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BuilderOptions.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.CanBeArray.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateBuilderParams.html +23 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateExtensions.html +5 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateIssuerOrSubject.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateOID.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateOptions.html +15 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificatePublicKeyInfo.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateSchema.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateValidity.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateVersionInfo.html +5 -0
- package/docs/types/KeetaNetSDK.Referenced.ClientErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ClientRepresentative.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocks.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocksByAccount.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.CreateIdentifierRequest.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.DecodeFunc.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.DelegationUpdate.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.DeserializerCallback.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.DurationBreakdowns.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ED25519PublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.EncodeFunc.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ExternalFlagName.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ExternalKeyPairFunctions.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ExternalPermissionOffsetSet.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.FlagGroupType.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.FlagOrExternalName.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.FlagOrExternalNames.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.GenericAccount.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.GetAccountStateAPIResponse.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.GetAccountStateAPIResponseFailure.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.GetAccountStateAPIResponseFormatted.html +28 -0
- package/docs/types/KeetaNetSDK.Referenced.GetAccountStateAPIResponseSuccess.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.GetAllBalancesResponse.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.GetPrevFunction.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.GetVotesAfterOptions.html +8 -0
- package/docs/types/KeetaNetSDK.Referenced.IdentifierAddress.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.IdentifierKeyAlgorithm.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.IdentifierPublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.InitialGenResponse.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.JSONMessage.html +7 -0
- package/docs/types/KeetaNetSDK.Referenced.JSONSupportedObject.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.JSONSupportedValue.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.JSONUnsupportedTypes.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.KVErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.KeyPairTypes.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.LedgerErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.LedgerSelector.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.LedgerStorage.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.Mutable.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.NetworkAddress.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.NetworkPublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.NodeLike.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.P2PPeer.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.P2PPeerRep.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.PaginatedVotes.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.PerAccount.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.PermissionOffsetSet.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.PermissionsErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.PublicKeyStringPrefixed.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.Secp256K1PublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.Secp256R1PublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.SerializedConnection.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.StoragePublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.TimeStat.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.TimeStats.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.TokenAddress.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.TokenEntry.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.TokenOrPending.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.TokenPublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.UserClientIntervals.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.UserClientListeners.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.UserClientOptionsReadOnly.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.UserClientOrClientAndNetwork.html +5 -0
- package/docs/types/KeetaNetSDK.Referenced.Vote.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.VoteErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.VoteJSONOutput.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.VoteOptions.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.decryptFunctionType.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.encryptFunctionType.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.fromSeedFunctionType.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.publicKeyASN1.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.seedDerivationFunction.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.signFunctionType.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.Endpoints.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +11 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkOrID.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.Networks.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.Representative.html +9 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1AnyJS.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1ContextTag.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1SequenceValidation.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.Schema.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.SchemaMap.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.JSONSerializable.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.JSONSerializableObject.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.JSONSupported.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializable.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializableOptions.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_helper.DeepMutable.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_helper.DistributiveOmit.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.verifyFunctionType.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.AccountErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.AccountErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.AccountPrefixes.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.BlockErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.ClientErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.ClientErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.KVErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.KVErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.LedgerErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.LedgerErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.Operation.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.PermissionsErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.PermissionsErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.VoteErrorCodes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.VoteErrorType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.default.html +3 -0
- package/docs/variables/KeetaNetSDK.Referenced.durationRanges.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.externalFlagPrefix.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.identifierKeyTypes.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_config.NetworkIDs.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_config.baseValidationConfig.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_config.networksArray.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BigIntToBuffer.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1IntegerToBigInt.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1toJS.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_asn1.JStoASN1.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_asn1.asn1.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_hash.HashFunctionLength.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_hash.HashFunctionName.html +2 -0
- package/docs/variables/KeetaNetSDK.lib.html +4 -0
- package/examples/basic/index.js +82 -0
- package/examples/basic/package-lock.json +126 -0
- package/examples/basic/package.json +14 -0
- package/examples/rwa-nft/index.js +517 -0
- package/examples/rwa-nft/package-lock.json +126 -0
- package/examples/rwa-nft/package.json +14 -0
- package/lib/account.d.ts +2 -2
- package/lib/block/index.d.ts +1 -1
- package/lib/block/operations.d.ts +1 -1
- package/lib/error/account.d.ts +1 -1
- package/lib/error/block.d.ts +1 -1
- package/lib/error/client.d.ts +2 -2
- package/lib/error/index.d.ts +1 -1
- package/lib/error/kv.d.ts +1 -1
- package/lib/error/ledger.d.ts +1 -1
- package/lib/error/permissions.d.ts +1 -1
- package/lib/error/vote.d.ts +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/kv/index.d.ts +2 -3
- package/lib/kv/kv_dynamodb.d.ts +1 -1
- package/lib/kv/kv_memory.d.ts +1 -1
- package/lib/kv/kv_redis.d.ts +1 -5
- package/lib/ledger/common.d.ts +2 -0
- package/lib/ledger/db_dynamodb.d.ts +2 -2
- package/lib/ledger/db_postgres.d.ts +1 -1
- package/lib/ledger/db_spanner.d.ts +5 -4
- package/lib/ledger/db_spanner_helper.d.ts +1 -2
- package/lib/ledger/db_sqlite.d.ts +1 -1
- package/lib/ledger/index.d.ts +6 -5
- package/lib/ledger/types.d.ts +53 -1
- package/lib/p2p.d.ts +1 -1
- package/lib/permissions.d.ts +1 -1
- package/lib/stats.d.ts +1 -1
- package/lib/utils/asn1.d.ts +0 -14
- package/lib/utils/buffer.d.ts +0 -1
- package/lib/utils/certificate.d.ts +2 -2
- package/lib/utils/conversion.d.ts +1 -1
- package/lib/utils/hash.d.ts +0 -1
- package/lib/vote.d.ts +1 -1
- package/package.json +5 -2
- package/version.d.ts +1 -1
- package/._version.d.ts +0 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Load the KeetaNet Client SDK
|
|
5
|
+
*/
|
|
6
|
+
const KeetaNet = require('@keetanetwork/keetanet-client');
|
|
7
|
+
const util = require('node:util');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This is the seed for the demo account. It is used to generate a public key
|
|
11
|
+
* and private key pair.
|
|
12
|
+
*
|
|
13
|
+
* DO NOT USE THIS FOR ANY OTHER PURPOSES OTHER THAN DEMONSTRATION.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
const DEMO_ACCOUNT_SEED = 'D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0';
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Create some local aliases for the KeetaNet Client SDK
|
|
20
|
+
* use shorter names
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Debug Print Object
|
|
24
|
+
*
|
|
25
|
+
* This is a utility function which is used to print objects
|
|
26
|
+
* in a debuggable format. It uses the util.inspect
|
|
27
|
+
* to colorize the output and set the depth to 10.
|
|
28
|
+
*
|
|
29
|
+
* @param {Parameters<typeof KeetaNet.lib.Utils.Helper.debugPrintableObject>} args - The arguments to pass to the the KeetaNet Debug Printable Object method
|
|
30
|
+
*/
|
|
31
|
+
function DPO(...args) {
|
|
32
|
+
return(util.inspect(KeetaNet.lib.Utils.Helper.debugPrintableObject(...args), {
|
|
33
|
+
depth: 10,
|
|
34
|
+
colors: true
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Many functions require an ArrayBuffer but some of our conversions are
|
|
40
|
+
* Buffer objects, so we need to convert them to ArrayBuffer objects.
|
|
41
|
+
*
|
|
42
|
+
* @param {Buffer|string} buffer - The Buffer object to convert to an ArrayBuffer
|
|
43
|
+
* @param {string} [encoding] - The encoding to use when a string an ArrayBuffer
|
|
44
|
+
*/
|
|
45
|
+
function toArrayBuffer(buffer, encoding) {
|
|
46
|
+
if (typeof buffer === 'string') {
|
|
47
|
+
if (encoding === undefined || encoding === null) {
|
|
48
|
+
encoding = 'utf8';
|
|
49
|
+
}
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
buffer = Buffer.from(buffer, encoding);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!Buffer.isBuffer(buffer)) {
|
|
55
|
+
throw(new Error('Buffer is not a Buffer object'));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const retval = new Uint8Array(buffer.length);
|
|
59
|
+
buffer.copy(retval);
|
|
60
|
+
|
|
61
|
+
return(retval);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Create a non-fungible token (NFT) for a real-world asset (RWA).
|
|
66
|
+
*
|
|
67
|
+
* The real world asset is represented by a token on the KeetaNet network
|
|
68
|
+
* with a supply of 1 and containing metadata which describes the asset
|
|
69
|
+
* and is signed by the authority.
|
|
70
|
+
*
|
|
71
|
+
* @param {KeetaNet.UserClient} client - The KeetaNet UserClient which is used to
|
|
72
|
+
* interact with the KeetaNet network.
|
|
73
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} signer_account - The account which is used to sign
|
|
74
|
+
* the transaction.
|
|
75
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} authority_account - The account which is used to
|
|
76
|
+
* sign the metadata for the token.
|
|
77
|
+
* @param {string} asset_id - The ID of the asset which is represented by the
|
|
78
|
+
* token.
|
|
79
|
+
*/
|
|
80
|
+
async function createNFTokenForRWA(client, signer_account, authority_account, asset_id) {
|
|
81
|
+
/**
|
|
82
|
+
* Assert that the signer is of an account type which can
|
|
83
|
+
* sign transactions -- because we didn't specify the set
|
|
84
|
+
* of account types in the type definition it's too broad
|
|
85
|
+
* and could accept any kind of account -- such as a token
|
|
86
|
+
* or storage account, which cannot sign transactions.
|
|
87
|
+
*/
|
|
88
|
+
if (!signer_account.isAccount()) {
|
|
89
|
+
throw(new Error('Signer account must be an account type which can sign transactions'));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Create the signed metadata
|
|
94
|
+
*/
|
|
95
|
+
/* convert the asset_id to an ArrayBuffer */
|
|
96
|
+
const asset_id_buffer = toArrayBuffer(asset_id, 'utf-8');
|
|
97
|
+
const signature = await authority_account.sign(asset_id_buffer);
|
|
98
|
+
const metadata_object = {
|
|
99
|
+
asset_id: asset_id,
|
|
100
|
+
authority: authority_account.publicKeyString.get(),
|
|
101
|
+
signature: signature.toString('base64')
|
|
102
|
+
};
|
|
103
|
+
const metadata_buffer = Buffer.from(JSON.stringify(metadata_object));
|
|
104
|
+
const metadata_base64 = metadata_buffer.toString('base64');
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Create a builder which is used to construct a transaction.
|
|
108
|
+
*/
|
|
109
|
+
const builder = client.initBuilder();
|
|
110
|
+
builder.updateAccounts({
|
|
111
|
+
/*
|
|
112
|
+
* We supply the signer here in case the client was
|
|
113
|
+
* constructed with a different client account. This may not be
|
|
114
|
+
* needed depending on the specifics of the contract between
|
|
115
|
+
* the methods used in a real-world application.
|
|
116
|
+
*/
|
|
117
|
+
signer: signer_account,
|
|
118
|
+
account: signer_account
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Create a token which is used to represent the asset.
|
|
123
|
+
*/
|
|
124
|
+
const token = builder.generateIdentifier(KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN);
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* We need to explicitly compute the blocks at this point to cause
|
|
128
|
+
* the token to be created, which will allow us to access the
|
|
129
|
+
* token address in order to set the supply and metadata.
|
|
130
|
+
*
|
|
131
|
+
* This will mutate the state of the builder and seal off the
|
|
132
|
+
* first block, however multiple blocks can be computed in a single
|
|
133
|
+
* builder and they can all be published atomically in a single
|
|
134
|
+
* Vote Staple.
|
|
135
|
+
*/
|
|
136
|
+
await client.computeBuilderBlocks(builder);
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Give the token a supply of 1, this is a non-fungible token.
|
|
140
|
+
* because the supply is indivisible and there can only one
|
|
141
|
+
* or zero owners of the token's entire supply.
|
|
142
|
+
*/
|
|
143
|
+
builder.modifyTokenSupply(1n, {
|
|
144
|
+
account: token.account
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Add the metadata to link the token to the real world asset
|
|
149
|
+
* on the authority of the authority account.
|
|
150
|
+
*/
|
|
151
|
+
builder.setInfo({
|
|
152
|
+
name: 'DEMORWA',
|
|
153
|
+
description: 'Demo Token for Real World Asset',
|
|
154
|
+
/**
|
|
155
|
+
* Here we link the token to the real world asset by setting
|
|
156
|
+
* the signed metadata object as the token's metadata.
|
|
157
|
+
*/
|
|
158
|
+
metadata: metadata_base64,
|
|
159
|
+
/**
|
|
160
|
+
* Set the default permissions for the token to allow
|
|
161
|
+
* all users to be able to hold the token -- if the set
|
|
162
|
+
* of desired holders needs to be more tightly controlled
|
|
163
|
+
* then the default permission can exlude the ACCESS flag
|
|
164
|
+
* and individual permissions can be set for each account
|
|
165
|
+
* or [future: based on parameters within a certificate]
|
|
166
|
+
*
|
|
167
|
+
* This would inhibit the ability to transfer the token to
|
|
168
|
+
* other users, but would allow the token to be held
|
|
169
|
+
* by a selected set of users.
|
|
170
|
+
*/
|
|
171
|
+
defaultPermission: new KeetaNet.lib.Permissions(['ACCESS'], [])
|
|
172
|
+
}, {
|
|
173
|
+
account: token.account
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const blocks = await client.computeBuilderBlocks(builder);
|
|
177
|
+
console.debug('Blocks to create token:', DPO(blocks.blocks));
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Publish the blocks to the network.
|
|
181
|
+
*/
|
|
182
|
+
await client.publishBuilder(builder);
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Return the token account
|
|
186
|
+
*/
|
|
187
|
+
return(token.account);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Try to find an existing token which represents the asset.
|
|
193
|
+
*
|
|
194
|
+
* @param {KeetaNet.UserClient} client - The KeetaNet UserClient which is used to
|
|
195
|
+
* interact with the KeetaNet network.
|
|
196
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} search_account - The account to search for the token
|
|
197
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} authority_account - The account which is used to
|
|
198
|
+
* sign the metadata for the token.
|
|
199
|
+
* @param {string} asset_id - The ID of the asset which is represented by the
|
|
200
|
+
* token.
|
|
201
|
+
* @returns {Promise<InstanceType<typeof KeetaNet.lib.Account<typeof KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN>> | null>} - The token account which represents the asset.
|
|
202
|
+
*/
|
|
203
|
+
async function lookupTokenForRWA(client, search_account, authority_account, asset_id) {
|
|
204
|
+
/**
|
|
205
|
+
* Look for an existing token which represents the asset.
|
|
206
|
+
*/
|
|
207
|
+
const all_tokens = await client.listACLsByPrincipalWithInfo({
|
|
208
|
+
account: search_account
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Filter all the tokens to find the one which matches the asset_id --
|
|
213
|
+
* [future: This method will be updated to allow searching based on
|
|
214
|
+
* saved information].
|
|
215
|
+
*/
|
|
216
|
+
const found_token_info = all_tokens.find(function(entry) {
|
|
217
|
+
try {
|
|
218
|
+
/**
|
|
219
|
+
* We only want to consider tokens
|
|
220
|
+
*/
|
|
221
|
+
if (!entry.entity.isToken()) {
|
|
222
|
+
return(false);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const check_data_buffer = Buffer.from(entry.info.metadata, 'base64');
|
|
226
|
+
/** @type {unknown} */
|
|
227
|
+
const check_data = JSON.parse(check_data_buffer.toString('utf8'));
|
|
228
|
+
/**
|
|
229
|
+
* Check the asset_id and authority account
|
|
230
|
+
* against the token's metadata.
|
|
231
|
+
*/
|
|
232
|
+
if (typeof check_data !== 'object' || check_data === null || check_data === undefined) {
|
|
233
|
+
return(false);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
if (!('asset_id' in check_data) || !('authority' in check_data) || !('signature' in check_data)) {
|
|
238
|
+
return(false);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (check_data.asset_id !== asset_id) {
|
|
242
|
+
return(false);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (typeof check_data.authority !== 'string') {
|
|
246
|
+
return(false);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (typeof check_data.signature !== 'string') {
|
|
250
|
+
return(false);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const check_data_authority = KeetaNet.lib.Account.fromPublicKeyString(check_data.authority);
|
|
254
|
+
if (!authority_account.comparePublicKey(check_data_authority)) {
|
|
255
|
+
return(false);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Verify the signature */
|
|
259
|
+
const asset_id_buffer = toArrayBuffer(check_data.asset_id, 'utf-8');
|
|
260
|
+
const check_signature = toArrayBuffer(check_data.signature, 'base64');
|
|
261
|
+
const valid_signature = check_data_authority.verify(asset_id_buffer, check_signature);
|
|
262
|
+
if (!valid_signature) {
|
|
263
|
+
return(false);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return(true);
|
|
267
|
+
} catch {
|
|
268
|
+
return(false);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
if (found_token_info !== undefined) {
|
|
273
|
+
/**
|
|
274
|
+
* We previously checked that the token was a token, but that
|
|
275
|
+
* type information is lost so we need to re-assert it here
|
|
276
|
+
*/
|
|
277
|
+
if (!found_token_info.entity.isToken()) {
|
|
278
|
+
throw(new Error('internal error: Found token is not a token'));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return(found_token_info.entity);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return(null);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Try to find an existing token which represents the asset. If it does not
|
|
290
|
+
* exist, create a new token using {@link createNFTokenForRWA}.
|
|
291
|
+
*
|
|
292
|
+
* @param {KeetaNet.UserClient} client - The KeetaNet UserClient which is used to
|
|
293
|
+
* interact with the KeetaNet network.
|
|
294
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} signer_account - The account which is used to sign
|
|
295
|
+
* the transaction.
|
|
296
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} authority_account - The account which is used to
|
|
297
|
+
* sign the metadata for the token.
|
|
298
|
+
* @param {string} asset_id - The ID of the asset which is represented by the
|
|
299
|
+
* token.
|
|
300
|
+
*/
|
|
301
|
+
async function createOrLookupTokenForRWA(client, signer_account, authority_account, asset_id) {
|
|
302
|
+
const found_token = await lookupTokenForRWA(client, signer_account, authority_account, asset_id);
|
|
303
|
+
if (found_token !== null) {
|
|
304
|
+
return(found_token);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* If the token does not exist, create a new token using
|
|
309
|
+
* {@link createNFTokenForRWA}.
|
|
310
|
+
*/
|
|
311
|
+
const token = await createNFTokenForRWA(client, signer_account, authority_account, asset_id);
|
|
312
|
+
return(token);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Determine which account owns the token
|
|
317
|
+
*
|
|
318
|
+
* [future: This method will be updated to allow searching based on
|
|
319
|
+
* the network address of the token, which is not currently available
|
|
320
|
+
* in the KeetaNet Client SDK]
|
|
321
|
+
*
|
|
322
|
+
* @param {KeetaNet.UserClient} client - The KeetaNet UserClient which is used
|
|
323
|
+
* to interact with the KeetaNet network.
|
|
324
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account<typeof KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN>>} token - The token which
|
|
325
|
+
* is used to represent the asset.
|
|
326
|
+
* @param {Array<InstanceType<typeof KeetaNet.lib.Account>>} accounts - The
|
|
327
|
+
* accounts which are used to check the ownership of the token.
|
|
328
|
+
*/
|
|
329
|
+
async function checkNFTokenOwnership(client, token, accounts) {
|
|
330
|
+
/**
|
|
331
|
+
* Check the ownership of the token by checking the balance
|
|
332
|
+
* of each account.
|
|
333
|
+
*/
|
|
334
|
+
for (const account of accounts) {
|
|
335
|
+
const balance = await client.balance(token, {
|
|
336
|
+
account: account
|
|
337
|
+
});
|
|
338
|
+
if (balance > 0n) {
|
|
339
|
+
return(account);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return(null);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Perform an atomic swap of the token between two accounts. The {@link from}
|
|
348
|
+
* account will send the Non-Fungible Token (NFT) to the {@link to} account and
|
|
349
|
+
* it will swap that for some of the base token.
|
|
350
|
+
*
|
|
351
|
+
* Any token could be used in the swap, but in this case we will use the
|
|
352
|
+
* base token for simplicity.
|
|
353
|
+
*
|
|
354
|
+
* The swap is atomic, meaning that either both the token and the base
|
|
355
|
+
* token are transferred or neither is transferred. This is done by
|
|
356
|
+
* using a single transaction to perform the swap using the "Receive"
|
|
357
|
+
* constraining operation.
|
|
358
|
+
*
|
|
359
|
+
* @param {KeetaNet.UserClient} client - The KeetaNet UserClient which is used
|
|
360
|
+
* to interact with the KeetaNet network.
|
|
361
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account<typeof KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN>>} token - The token which to swap
|
|
362
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} from - The account which
|
|
363
|
+
* is used to swap the token from -- i.e., the current holder.
|
|
364
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} to - The account which
|
|
365
|
+
* is used to swap the token to -- i.e., the destination holder.
|
|
366
|
+
* @param {InstanceType<typeof KeetaNet.lib.Account>} [from_signer] - The
|
|
367
|
+
* account which is used to sign the transaction on the behalf of the
|
|
368
|
+
* {@link from} account. This is optional and if not provided then the
|
|
369
|
+
* {@link from} account will be used to sign the transaction.
|
|
370
|
+
*/
|
|
371
|
+
async function performNFTokenAtomicSwap(client, token, from, to, from_signer) {
|
|
372
|
+
const builder = client.initBuilder();
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Have the sender send the tokens to the receiver.
|
|
376
|
+
*
|
|
377
|
+
* We do this first because the block ordering requires
|
|
378
|
+
* that the receive operation be after the send operation.
|
|
379
|
+
*/
|
|
380
|
+
builder.updateAccounts({
|
|
381
|
+
signer: to.assertAccount(),
|
|
382
|
+
account: to
|
|
383
|
+
});
|
|
384
|
+
builder.send(from_signer ?? from, 30n, client.baseToken);
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Add a send operation to the builder which will send the Non-Fungible
|
|
388
|
+
* Token (NFT) to the {@link to} account.
|
|
389
|
+
*/
|
|
390
|
+
builder.updateAccounts({
|
|
391
|
+
/**
|
|
392
|
+
* The signer is the account which is used to sign the
|
|
393
|
+
* transaction, because the {@link from} account may be a token
|
|
394
|
+
* account which cannot sign transactions we provide for
|
|
395
|
+
* an alternate signer.
|
|
396
|
+
*/
|
|
397
|
+
signer: (from_signer ?? from).assertAccount(),
|
|
398
|
+
account: from
|
|
399
|
+
});
|
|
400
|
+
builder.send(to, 1n, token);
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Enforce that we receive 30 of the base token in exchange for the
|
|
404
|
+
* NFT.
|
|
405
|
+
*/
|
|
406
|
+
if (from_signer !== undefined) {
|
|
407
|
+
/**
|
|
408
|
+
* Since the token cannot hold a balance of another
|
|
409
|
+
* token we must swap that with a different account
|
|
410
|
+
* which can hold the base token -- we will re-use
|
|
411
|
+
* the signer account for this purpose.
|
|
412
|
+
*/
|
|
413
|
+
builder.updateAccounts({
|
|
414
|
+
account: from_signer
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
builder.receive(to, 30n, client.baseToken);
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Compute the blocks for the transaction.
|
|
421
|
+
*/
|
|
422
|
+
const block_info = await client.computeBuilderBlocks(builder);
|
|
423
|
+
console.debug('Blocks to perform atomic swap:', DPO(block_info.blocks));
|
|
424
|
+
|
|
425
|
+
await client.publishBuilder(builder);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async function main() {
|
|
429
|
+
/**
|
|
430
|
+
* Create an account to act as the authority for issuing the mapping
|
|
431
|
+
* between the asset and the token. The asset is represented by a token,
|
|
432
|
+
* but in order to prove ownership of the asset, the authority must sign the
|
|
433
|
+
* metadata for the token.
|
|
434
|
+
*/
|
|
435
|
+
const authority_account = KeetaNet.lib.Account.fromSeed(DEMO_ACCOUNT_SEED, 0);
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* In this demonstration we will use the same account to sign the transaction
|
|
439
|
+
* as the authority over the mapping between the asset and the token.
|
|
440
|
+
*
|
|
441
|
+
* In a real-world application, this might be seperated for business
|
|
442
|
+
* concerns.
|
|
443
|
+
*/
|
|
444
|
+
const signer_account = authority_account;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Create an account to represent an initial owner of the token/asset.
|
|
448
|
+
*/
|
|
449
|
+
const user1_account = KeetaNet.lib.Account.fromSeed(DEMO_ACCOUNT_SEED, 1);
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Create an account to represent the final owner of the token/asset after
|
|
453
|
+
* exchange.
|
|
454
|
+
*/
|
|
455
|
+
const user2_account = KeetaNet.lib.Account.fromSeed(DEMO_ACCOUNT_SEED, 2);
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Log the public keys of the accounts for demonstration purposes.
|
|
459
|
+
*/
|
|
460
|
+
console.log('Authority Account:', DPO(authority_account));
|
|
461
|
+
console.log('Signer Account:', DPO(signer_account));
|
|
462
|
+
console.log('User 1 Account:', DPO(user1_account));
|
|
463
|
+
console.log('User 2 Account:', DPO(user2_account));
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Construct a KeetaNet UserClient which is used to interact with the
|
|
467
|
+
* KeetaNet network as a user.
|
|
468
|
+
*
|
|
469
|
+
* We will use the test network for this demo, and the account we just
|
|
470
|
+
* created.
|
|
471
|
+
*/
|
|
472
|
+
const client = KeetaNet.UserClient.fromNetwork('test', signer_account);
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Create or search for an asset to represent the real-world asset.
|
|
476
|
+
*/
|
|
477
|
+
const token = await createOrLookupTokenForRWA(client, signer_account, authority_account, 'asset://1f0ccae9-5666-4f38-be24-36605630ac45/1');
|
|
478
|
+
console.log('Token:', DPO(token));
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Find out which, if either, of the two users owns the token
|
|
482
|
+
*/
|
|
483
|
+
const user_token_owner = await checkNFTokenOwnership(client, token, [user1_account, user2_account, token]);
|
|
484
|
+
let user_token_nonowner;
|
|
485
|
+
let user_token_owner_signer;
|
|
486
|
+
if (user1_account.comparePublicKey(user_token_owner)) {
|
|
487
|
+
/* User 1 has the token */
|
|
488
|
+
user_token_nonowner = user2_account;
|
|
489
|
+
} else if (user2_account.comparePublicKey(user_token_owner)) {
|
|
490
|
+
/* User 2 has the token */
|
|
491
|
+
user_token_nonowner = user1_account;
|
|
492
|
+
} else if (token.comparePublicKey(user_token_owner)) {
|
|
493
|
+
/* The token has the token */
|
|
494
|
+
user_token_nonowner = user1_account;
|
|
495
|
+
user_token_owner_signer = signer_account;
|
|
496
|
+
} else {
|
|
497
|
+
/* No one has the token */
|
|
498
|
+
throw(new Error('No one has the token'));
|
|
499
|
+
}
|
|
500
|
+
console.log('User which owns the token:', DPO(user_token_owner));
|
|
501
|
+
console.log('User which does not own the token:', DPO(user_token_nonowner));
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Transfer the token from the owner to the non-owner.
|
|
505
|
+
*/
|
|
506
|
+
await performNFTokenAtomicSwap(client, token, user_token_owner, user_token_nonowner, user_token_owner_signer);
|
|
507
|
+
|
|
508
|
+
const new_user_token_owner = await checkNFTokenOwnership(client, token, [user1_account, user2_account, token]);
|
|
509
|
+
console.log('New User which owns the token:', DPO(new_user_token_owner));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
main().then(function() {
|
|
513
|
+
process.exit(0);
|
|
514
|
+
}, function(err) {
|
|
515
|
+
console.error(err);
|
|
516
|
+
process.exit(1);
|
|
517
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "keetanet-client-examples-rwa-nft",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "keetanet-client-examples-rwa-nft",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@keetanetwork/keetanet-client": "0.10.3"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"node_modules/@keetanetwork/keetanet-client": {
|
|
16
|
+
"version": "0.10.3",
|
|
17
|
+
"resolved": "https://registry.npmjs.org/@keetanetwork/keetanet-client/-/keetanet-client-0.10.3.tgz",
|
|
18
|
+
"integrity": "sha512-8gH8daH/7aKxTbhjWa2qMS0nNtRWStLVrXnGb242FokkmtxuprZl7P4hLbOQqHSMmPAM9//p8BGpPxwbng3AiQ==",
|
|
19
|
+
"license": "see LICENSE",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"secp256k1": "5.0.1"
|
|
22
|
+
},
|
|
23
|
+
"optionalDependencies": {
|
|
24
|
+
"@keetanetwork/asn1-napi-rs": "1.1.9"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"node_modules/bn.js": {
|
|
28
|
+
"version": "4.12.2",
|
|
29
|
+
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz",
|
|
30
|
+
"integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==",
|
|
31
|
+
"license": "MIT"
|
|
32
|
+
},
|
|
33
|
+
"node_modules/brorand": {
|
|
34
|
+
"version": "1.1.0",
|
|
35
|
+
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
|
|
36
|
+
"integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==",
|
|
37
|
+
"license": "MIT"
|
|
38
|
+
},
|
|
39
|
+
"node_modules/elliptic": {
|
|
40
|
+
"version": "6.6.1",
|
|
41
|
+
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz",
|
|
42
|
+
"integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"bn.js": "^4.11.9",
|
|
46
|
+
"brorand": "^1.1.0",
|
|
47
|
+
"hash.js": "^1.0.0",
|
|
48
|
+
"hmac-drbg": "^1.0.1",
|
|
49
|
+
"inherits": "^2.0.4",
|
|
50
|
+
"minimalistic-assert": "^1.0.1",
|
|
51
|
+
"minimalistic-crypto-utils": "^1.0.1"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"node_modules/hash.js": {
|
|
55
|
+
"version": "1.1.7",
|
|
56
|
+
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
|
|
57
|
+
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"inherits": "^2.0.3",
|
|
61
|
+
"minimalistic-assert": "^1.0.1"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"node_modules/hmac-drbg": {
|
|
65
|
+
"version": "1.0.1",
|
|
66
|
+
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
|
67
|
+
"integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==",
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"hash.js": "^1.0.3",
|
|
71
|
+
"minimalistic-assert": "^1.0.0",
|
|
72
|
+
"minimalistic-crypto-utils": "^1.0.1"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"node_modules/inherits": {
|
|
76
|
+
"version": "2.0.4",
|
|
77
|
+
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
|
78
|
+
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
|
79
|
+
"license": "ISC"
|
|
80
|
+
},
|
|
81
|
+
"node_modules/minimalistic-assert": {
|
|
82
|
+
"version": "1.0.1",
|
|
83
|
+
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
|
|
84
|
+
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
|
|
85
|
+
"license": "ISC"
|
|
86
|
+
},
|
|
87
|
+
"node_modules/minimalistic-crypto-utils": {
|
|
88
|
+
"version": "1.0.1",
|
|
89
|
+
"resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
|
|
90
|
+
"integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==",
|
|
91
|
+
"license": "MIT"
|
|
92
|
+
},
|
|
93
|
+
"node_modules/node-addon-api": {
|
|
94
|
+
"version": "5.1.0",
|
|
95
|
+
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz",
|
|
96
|
+
"integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==",
|
|
97
|
+
"license": "MIT"
|
|
98
|
+
},
|
|
99
|
+
"node_modules/node-gyp-build": {
|
|
100
|
+
"version": "4.8.4",
|
|
101
|
+
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
|
|
102
|
+
"integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
|
|
103
|
+
"license": "MIT",
|
|
104
|
+
"bin": {
|
|
105
|
+
"node-gyp-build": "bin.js",
|
|
106
|
+
"node-gyp-build-optional": "optional.js",
|
|
107
|
+
"node-gyp-build-test": "build-test.js"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"node_modules/secp256k1": {
|
|
111
|
+
"version": "5.0.1",
|
|
112
|
+
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.1.tgz",
|
|
113
|
+
"integrity": "sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA==",
|
|
114
|
+
"hasInstallScript": true,
|
|
115
|
+
"license": "MIT",
|
|
116
|
+
"dependencies": {
|
|
117
|
+
"elliptic": "^6.5.7",
|
|
118
|
+
"node-addon-api": "^5.0.0",
|
|
119
|
+
"node-gyp-build": "^4.2.0"
|
|
120
|
+
},
|
|
121
|
+
"engines": {
|
|
122
|
+
"node": ">=18.0.0"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "keetanet-client-examples-rwa-nft",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Basic example of using KeetaNet SDK with Real World Asset that is Non-Fungible",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"demo": "node index.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "Keeta Token Genesis LLC",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@keetanetwork/keetanet-client": "0.10.3"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/lib/account.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BufferStorage from './utils/buffer';
|
|
1
|
+
import { BufferStorage } from './utils/buffer';
|
|
2
2
|
import { BufferStorageASN1 } from './utils/asn1';
|
|
3
3
|
import { BlockHash } from './block';
|
|
4
4
|
/**
|
|
@@ -19,7 +19,7 @@ export declare enum AccountKeyAlgorithm {
|
|
|
19
19
|
ECDSA_SECP256R1 = 6
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Type for ASN.1 encoded public keys -- this is equivalent to @
|
|
22
|
+
* Type for ASN.1 encoded public keys -- this is equivalent to {@link ValidateASN1.SchemaMap<typeof publicKeyASN1Schema>}
|
|
23
23
|
* but does not reference a complex type which may exceed TypeScripts limits
|
|
24
24
|
*/
|
|
25
25
|
type publicKeyASN1 = [
|
package/lib/block/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GenericAccount } from '../account';
|
|
2
2
|
import Account from '../account';
|
|
3
|
-
import BufferStorage from '../utils/buffer';
|
|
3
|
+
import { BufferStorage } from '../utils/buffer';
|
|
4
4
|
import * as ASN1 from '../utils/asn1';
|
|
5
5
|
import type { JSONSupported, ToJSONSerializableOptions } from '../utils/conversion';
|
|
6
6
|
import * as Operations from './operations';
|
|
@@ -3,7 +3,7 @@ import type { DeepMutable } from '../utils/helper';
|
|
|
3
3
|
import type { GenericAccount, IdentifierAddress, TokenAddress, TokenPublicKeyString } from '../account';
|
|
4
4
|
import Account from '../account';
|
|
5
5
|
import type { AcceptedPermissionTypes } from '../permissions';
|
|
6
|
-
import Permissions from '../permissions';
|
|
6
|
+
import { Permissions } from '../permissions';
|
|
7
7
|
import type { JSONSupported } from '../utils/conversion';
|
|
8
8
|
import Block, { AdjustMethod } from '.';
|
|
9
9
|
/**
|