Browse Source

New translations values.md (Spanish)

translation_master
Jonathon Hammond 3 years ago
parent
commit
36654f295c
  1. 12
      src/pages/es/write-smart-contracts/values.md

12
src/pages/es/write-smart-contracts/values.md

@ -75,9 +75,9 @@ If you are dealing with a function or contract function that returns an `Optiona
```typescript
const maybeVal: OptionalCV = await callReadOnlyFunction(...);
if (maybeVal.type === ClarityType. OptionalSome) {
if (maybeVal.type === ClarityType.OptionalSome) {
console.log(maybeVal.value);
} else if (maybeVal.type === ClarityType. OptionalNone) {
} else if (maybeVal.type === ClarityType.OptionalNone) {
// deal with `none` value
}
```
@ -96,10 +96,10 @@ Clarity supports both integers and unsigned integers.
```typescript
const i: IntCV = intCV(-10);
// { type: ClarityType.Int, value: } }
// { type: ClarityType.Int, value: BN { ... } }
const u: UIntCV = uintCV(10);
// { type: ClarityType.UInt, value: } }
// { type: ClarityType.UInt, value: BN { ... } }
```
Clarity value ints store their underlying data as `BigNum` values from the [bn.js](https://github.com/indutny/bn.js/) library.
@ -253,9 +253,9 @@ const options = {
// returns a Response
const result: ResponseCV = await callReadOnlyFunction(options);
if (result.type === ClarityType. ResponseOk) {
if (result.type === ClarityType.ResponseOk) {
console.log(cvToString(result.value));
} else if (result.type === ClarityType. ResponseErr) {
} else if (result.type === ClarityType.ResponseErr) {
throw new Error(`kv-store contract error: ${result.value.data}`);
}
```

Loading…
Cancel
Save