示例#1
0
        public static Asset FromXDR(Generated.Asset asset)
        {
            switch (asset.Discriminant.InnerValue)
            {
            case Generated.AssetType.AssetTypeEnum.ASSET_TYPE_NATIVE:
                return(new Asset());

            case Generated.AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM4:
                return(new Asset(Encoding.ASCII.GetString(asset.AlphaNum4.AssetCode), KeyPair.FromXdrPublicKey(asset.AlphaNum4.Issuer.InnerValue)));

            case Generated.AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM12:
                return(new Asset(Encoding.ASCII.GetString(asset.AlphaNum12.AssetCode), KeyPair.FromXdrPublicKey(asset.AlphaNum12.Issuer.InnerValue)));

            default:
                throw new ArgumentException("Invalid asset.");
            }
        }
示例#2
0
 public Builder SetSourceAccount(KeyPair sourceAccount)
 {
     SourceAccount = CheckNotNull(sourceAccount, "sourceAccount cannot be null.");
     return(this);
 }
示例#3
0
 public Builder(Generated.Operation op)
 {
     Destination = KeyPair.FromXdrPublicKey(op.Body.Destination.InnerValue);
 }
示例#4
0
 public Builder(KeyPair destination)
 {
     Destination = CheckNotNull(destination, "destination cannot be null.");
 }
示例#5
0
 private AccountMergeOperation(KeyPair destination)
 {
     Destination = CheckNotNull(destination, "destination cannot be null.");
 }